Jump to content

Applescript help


Recommended Posts

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

Link to comment

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

Link to comment

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...