Create PPTP VPN Connection

Hello, how could I setup or deploy several PPTP-VPN connections via AppleScript? (System Preferences-Network-Add Interface-VPN-PPTP)

Thanks in advance!

Mac OS X (10.5)

Posted on Oct 7, 2009 6:17 AM

Reply
2 replies

Oct 7, 2009 1:20 PM in response to Neurobasher

I must confess that I don't know much about network connections. However, using [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html], the following script (tested on my MacBook Pro) should add one "VPN (PPTP)" connection to the Network pane of you System Preferences:

tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events"
tell process "System Preferences"
tell window 1
click button "Add Service"
tell sheet 1
click pop up button 1
click menu item "VPN" of menu 1 of pop up button 1
delay 1
click pop up button 2
click menu item "PPTP" of menu 1 of pop up button 2
click button "Create"
end tell
click button "Apply"
end tell
end tell
delay 1 -- optional (just for visual feedback)
keystroke "w" using {command down}
end tell
end tell

Before using this script, the Accessibility Frameworks must have been enabled by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane.

Message was edited by: Pierre L.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Create PPTP VPN Connection

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.