Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, 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?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.