Viscosity. OpenVPN client. For Mac.  
 
 

Search

Search our Knowledge Base to see if we already have an answer for your question:

Search

Browse KB

Browse articles in our Knowledge Base by category:

Browse

Features

Other articles in this category:

Configuring DNS and WINS settings
Using Tokens/Smartcards (PKCS#11)
Displaying Growl Notifications
Controlling Viscosity with AppleScript
Running AppleScripts When Connected/Disconnected

 

Controlling Viscosity with AppleScript
Knowledge Base > Features > Controlling Viscosity with AppleScript


Viscosity provides AppleScript support, allowing VPN connections to be connected, disconnected, or their name and state listed, from AppleScript scripts.

Viscosity Suite

AppleScript Classes

  • connection n : A connection.

    Properties
    name (text, r/o) : The name of the connection.
    state (text, r/o) : The name of the connection.

    Responds To
    connect, disconnect.

AppleScript Commands

  • connect name : the name of the VPN connection to connect
  • disconnect name : the name of the VPN connection to disconnect
  • connectall
  • disconnectall

Examples

Several examples of how you can interact with Viscosity using AppleScript have been included below.

Connect A Connection By Name

tell application "Viscosity" to connect "Home"

Disconnect A Connection By Name

tell application "Viscosity" to disconnect "Home"

Display Name Of The First Connection

tell application "Viscosity"

set connectionName to name of the first connection
display dialog connectionName

end tell

Display State Of The First Connection

tell application "Viscosity"

set connectionState to state of the first connection
display dialog connectionState

end tell

Action Depending On State Of The First Connection

tell application "Viscosity"

if the state of the first connection is "Connected" then ...

end tell

Connect All Connections

tell application "Viscosity" to connectall

Disconnect All Connections

tell application "Viscosity" to disconnectall




 
 
Navigate

Home
Applications
Blog
About
Support
  Support

Support Home
Documentation
Knowledge Base
Forum
  Community

Blog
Forum
Twitter
Viscosity
Viscosity Server


 
 
SparkLabs Copyright © SparkLabs. All Rights Reserved.