Internet Connect/VPN scripting

Is is possible to script a VPN connection? I’d like to do so as part of a larger script for remote connection–this is the only part I can’t get automated! This question was posed in an earlier thread:

http://bbs.applescript.net/viewtopic.php?t=3404&highlight=vpn

but never answered…I’m assuming that might mean it’s impossible. But why? Surely it’s no harder that the PPP connection scripts given?

Thanks for any help–this site is a great resource!

this seems like a pretty roundabout way to do it, but…

–with help from http://www.prefab.com/uibrowser/
–this script requires Apple GUI scripting: http://www.apple.com/applescript/GUI/#1002
–enable Universal access: System Preferences–>Universal Access: check all available options

tell application “Internet Connect” to activate
tell application “System Events”
tell application process “Internet Connect”
pick menu item “New VPN Connection Window” of menu “File” of menu bar 1
click button “Connect” of group 2 of window “VPN Connection”
end tell
end tell

this seems like a pretty roundabout way to do it, but…

Does anyone know whether VPN can be activated easily from Cocoa?[/i]

that’s funny, i do a search for “VPN” a year later and get my own old post! what justice.

anyway, i still have the same script, and, of course, panther breaks it. go figure. any suggestions? i will probably answer my own question and post it here, but i hope the process is a little easier this time!

oh, and it was easy.

that UI Browser program http://www.prefab.com/uibrowser/ is great for dummies like me, and now UI is included by default and the scripts that UI Browser generates will turn it on if it’s off! what a great program. they also linked from there to apples UI Inspector at http://www.apple.com/applescript/uiscripting/02.html

anyway, now it’s

tell application "Internet Connect" to activate
tell application "System Events"
	tell application process "Internet Connect"
		pick menu item "Connect" of menu "Connect" of menu bar item "Connect" of menu bar 1
		delay 5
	end tell
end tell

old news to most, i’m sure…still cool though!

This is like my own personal thread. Heh.

Anyway, I was recently reading Matt Neuburg’s recently released “AppleScript: The Definitive Guide,” which is very helpful when it comes to using AppleScript! In it, he suggests that :

“If you’re reduced to using GUI scripting to accomplish some goal, and if the target application is still being actively developed, then consider writing to the developer and requesting that the application be made genuinely scriptable”

So I did, at http://www.apple.com/macosx/feedback/.

I knwo it’s silly but now I feel better for having done it. Also, this book is very good. Highly recommended!