I set up an applescript application (saved under the name "BTGuard VPN-OSX) to force OSX to connect with my VPN service (BTGuard). I followed instructions from this link http://lifehacker.com/5932886/force-mac-os-x-to-automatically-reconnect-to-vpn, inserting "BTGuard" as my service.

This is what I entered in the Applescript box:

on idle
    tell application "System Events"
        tell current location of network preferences
            set myConnection to the service "BTGuard VPN"

            if myConnection is not null then

                if current configuration of myConnection is not connected then
                    connect myConnection
                end if
            end if
        end tell

        return 120
    end tell
end idle

However, when I click on the new app., I get this pop up message:

Can't get class svce "BTGuard VPN" of class locc of classnetp of application "System Events". I guess I don't know how to edit the command properly.

Can someone help me figure out the problem? Is it with the 'service'? What do?


You must log in to answer this question.

Browse other questions tagged .