Jump to content

Is applescript working for anyone?


Recommended Posts

I have many workflows built that use applescript and even though it is no longer marked as an incomplete feature I can't get any of them to work.

 

Even the simplest

 

 

tell application "Alfred 2"
    quit
end tell
 
 
I have much more complicated scripts I don't care to share until Alfred 2's released. Are you guys or gals having these issues too?
Link to comment

I have many workflows built that use applescript and even though it is no longer marked as an incomplete feature I can't get any of them to work.

 

Even the simplest

 

 

tell application "Alfred 2"
    quit
end tell
 
 
I have much more complicated scripts I don't care to share until Alfred 2's released. Are you guys or gals having these issues too?

 

You need to wrap the code with

on alfred_script(q)

-- your code

end alfred_script
Link to comment

Thanks. That worked like a charm. Not that it matters, but do you have any idea why that was added?

 

Alfred has now conceptually separated out NSAppleScript (foreground) and /usr/bin/osascript (shell, background) for running AppleScripts for a number of reasons.

 

For NSAppleScripts, you can have code outside the on alfred_script(q), but Alfred needs an entry point handler to call to ensure that the return value is the correct one.

 

To cut a long story short, Alfred v2 does it properly :)

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