Return to Snippet

Revision: 28223
at July 4, 2010 05:18 by iloveitaly


Initial Code
on toggle_vpn()
	tell application "System Events"
		repeat with s in services of network preferences
			if kind of s is 14 then -- 14 is VPN
				if not connected of configuration of s as boolean then
					tell s to connect
				else
					tell s to disconnect
				end if
			end if
		end repeat
	end tell
end toggle_vpn

Initial URL

                                

Initial Description

                                

Initial Title
Toggle VPN Connection

Initial Tags
mac

Initial Language
AppleScript