northmendo Posted February 28, 2013 Share Posted February 28, 2013 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
aiyo Posted February 28, 2013 Share Posted February 28, 2013 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
northmendo Posted February 28, 2013 Author Share Posted February 28, 2013 Thanks. That worked like a charm. Not that it matters, but do you have any idea why that was added? Link to comment
Andrew Posted February 28, 2013 Share Posted February 28, 2013 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
Andrew Posted February 28, 2013 Share Posted February 28, 2013 I forgot to add - if you use a "Run Script" action and /usr/bin/osascript instead, then you can just pop AppleScript in there without the alfred_script(q) bit as this is just running a raw AppleScript. Link to comment
northmendo Posted February 28, 2013 Author Share Posted February 28, 2013 Thanks. That makes perfect sense. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now