New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lion - The action "Run AppleScript" encountered an error. #5
Comments
Do you have "Enable access for assistive devices" enabled in your "Universal Access" system preferences? |
I do, and if I recall correctly, it's because Divvy requires it. |
I disabled it, getting the same issue. |
Hi @LifeCoder45 — sorry for not being clearer, you definitely need to leave assistive device access enabled for this script to work. The only other thing I can suggest is that you need to select the text in the document you want to reformat. The "Uncrustify Selected Source Code" workflow is always more reliable in my daily grind than the full document variant — you could try that and see if it works? The other thing to check is that |
I just ran in to this same thing and found it was due to errors in my uncrustify.cfg (which was mostly the gist from http://gist.github.com/261662/) When I ran uncrustify manually, I would see:
These seemed to cause uncrustify to return a non-0 exit status, so the script would bail. I simply commented out each offending line and now uncrustify returns a happy 0 status and the workflows are working correctly for me. Hope that helps. |
Errors aren't reported particularly well by my services, sadly (I'm not sure it's possible to intercept errors in Automator Workflows — I've never looked into it). Thanks for the information, @bricooke — hopefully it helps @LifeCoder45. |
I followed the instructions on http://www.nanaimostudio.com/blog/2012/6/27/the-productive-apple-developer-part-ii.html and ran into the same issue. However, in my case, it doesn't appear to be a bad .cfg because when I execute the same command, prepended by a "pbpaste | ", and if I place the text into the clipboard, it gets output just fine, without an error msg in Terminal. I am using 10.7.4 and access for assistive devices is enabled. Restarting OSX hasn't helped, either. I'll keep looking. Wouldn't be surprised if this is a new Lion bug - seen to many reggressions recently with Lion :( |
@tempelmann I use these scripts daily without issue under 10.7.4 and 10.8.0 DP4. Have you tried using my scripts in place of the one that Nanaimo Studio has posted? |
The script invocation itself works fine when I test it from the cmdline. |
Update: When I execute the script in automator, by prepending it with a "Get Specified Text" action, it fails with a very unhelpful error msg. But then I found a fix, after all: If I add a line "exit 0" to the end of the script, it works. So, somehow, uncrustify returns a non-zero result, which upsets Automator. Why the command returns non-zero (which indicates a failure) is unclear to me, though, because the cmd did work and outputs a reformatted source code, just like it should. |
I am getting this error, after attempting to run either of the two services. I have quadruple verified my install paths are correct.
I've updated all three paths to:
Which is where MacPorts installed Uncrustify.
Here is the Console output, the results of which I'm unable to find any Google hits on:
The text was updated successfully, but these errors were encountered: