timcnicholls Posted December 13, 2013 Posted December 13, 2013 (edited) I recently upgraded to Mavericks and am experiencing problems with Applescript-based workflows that were working fine previously. In attempting to debug the workflows, it seems that even basic RunNSAppleScript actions fail for scripts that work just fine in Script Editor. For instance, I tried a toy Keyword to Applescript workflow, with or without keyword arguments: on alfred_script(q) tell application “iTerm” activate end tell end alfred_script fails with the following output in Console: 13/12/2013 11:37:25.761 Alfred 2[381]: [ERROR] AppleScript Error: { NSAppleScriptErrorBriefMessage = "Expected expression, property or key form, etc. but found unknown token."; NSAppleScriptErrorMessage = "Expected expression, property or key form, etc. but found unknown token."; NSAppleScriptErrorNumber = "-2741"; NSAppleScriptErrorRange = "NSRange: {38, 1}"; } Other workflows, e.g. passing calendar sentences to Fantastical, continue to work fine. I'm running Alfred v2.1.1 (227) on Mac OSX Mavericks 10.9 build 13A603. Any suggestions on how to investigate this further? Thanks Tim Edited December 13, 2013 by timcnicholls
Andrew Posted December 13, 2013 Posted December 13, 2013 I recently upgraded to Mavericks and am experiencing problems with Applescript-based workflows that were working fine previously. In attempting to debug the workflows, it seems that even basic RunNSAppleScript actions fail for scripts that work just fine in Script Editor. For instance, I tried a toy Keyword to Applescript workflow, with or without keyword arguments: on alfred_script(q) tell application “iTerm” activate end tell end alfred_script fails with the following output in Console: 13/12/2013 11:37:25.761 Alfred 2[381]: [ERROR] AppleScript Error: { NSAppleScriptErrorBriefMessage = "Expected expression, property or key form, etc. but found unknown token."; NSAppleScriptErrorMessage = "Expected expression, property or key form, etc. but found unknown token."; NSAppleScriptErrorNumber = "-2741"; NSAppleScriptErrorRange = "NSRange: {38, 1}"; } Other workflows, e.g. passing calendar sentences to Fantastical, continue to work fine. I'm running Alfred v2.1.1 (227) on Mac OSX Mavericks 10.9 build 13A603. Any suggestions on how to investigate this further? Thanks Tim Hi Tim, It looks like Mavericks "Smart Quotes" is changing the quotation marks to unicode quotes instead of the straight up quotes. I had turned this auto substitution off automatically in almost every other place, but it looks like Alfred's AppleScript editor was overlooked. I'll get this fixed in the next release, but for now, if you right click in the text area where the AppleScript is being edited, select 'substitutions' and turn off "Smart Quotes", then you'll be able to get the AppleScript working with "iTerm". Cheers, Andrew wwvuillemot 1
timcnicholls Posted December 13, 2013 Author Posted December 13, 2013 Hi Andrew Great - that's fixed the problem, and the more complex scripts (e.g for creating Evernote notes) are now working again too having fixed the smart quote mangling. I also noticed it was substituting dashes in commented out lines of scripts. Thanks for the quick response. Cheers Tim
wwvuillemot Posted January 4, 2014 Posted January 4, 2014 Just adding my 2 cents that I ran into the same issue. And just to be clear and complete, indeed you must: turn off "smart quotes" from the right-click context menu for each impacted script re-do the quotes ("") anywhere in the script where smart quotes have been substituted Thanks for fixing!
jiku Posted March 4, 2014 Posted March 4, 2014 Was wondering why some of my workflows were failing. Great to have a tentative fix. Thanks!
Andrew Posted March 4, 2014 Posted March 4, 2014 This should now be fixed in the Alfred 2.2 b239 pre-release
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