Jump to content

Applescript help


Recommended Posts

Posted

Okie dokie, why isn't the query working in this?

 

on alfred_script(q)
tell application "Thyme"
    q
end tell
end alfred_script

 

If I hard code the values start, stop, pause, toggle it works fine. The query is passed through to the post notification. 

 

Best way to debug something simple like this?
 

Cheers,

 

Adam

Posted

The variable q is a string, so you get this:

tell application "Thyme"
    "start"
end tell

 

You can use if statements to achieve your goal:

 

on alfred_script(q)
tell application "Thyme"
    if q is "start" then
       start
    else if q is "stop" then
       stop
    else if q is "pause" then
       pause
    else
       toggle
    end if
end tell
end alfred_script

 

Hope this helps you

Posted

Brilliant. thanks Jonas. Despite all these years on a Mac I've not really bothered with Applescript yet!

 

Cheers,

 

Adam

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...