0

So I've never used applescripts before, and I don't know how to code.

I'm trying to use this script I found online, but I've been getting "Syntax Error: Expected Expression But Found Command Name"

any help would be appreciated

Code:

on idle
  tell application "System Events"
    tell current location of network preferences
      set myConnection to the service "BTGuard”
      if current configuration of myConnection is not connected then
        try
          tell application "transmission"
            quit
          end tell
          connect myConnection
          –say "Retrying connection"
        end try
      else
        tell application "transmission"
          run
        end tell
      end if
    end tell
    return 1
  end tell
end idle

2 Answers 2

1

Looks like you have some curly quotes closing the BTGuard string (probably a result of copying formatted text from someplace such as a web page) - the fix for that is changing the quotes to the normal straight ones. The other syntax problem is the comment character for the say statement - to comment a line like that, use either -- or the # character.

Sign up to request clarification or add additional context in comments.

Comments

0

Since you said you know nothing about applescript I'll ask... do you realize that this is a special applescript called a "stay-open" applescript? This means you must save it as an application and check the "stay-open" box for it to work properly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.