3 Replies Latest reply: Nov 1, 2010 2:55 PM by Barney-15E
tnine Level 1 Level 1 (0 points)
Hi all,
I've created an automator action to automatically organize my TV shows. The bulk of the service is written in python, and this script works perfectly when invoked from the command line with the directories as arguments.

However, whenever I run it via the right click action in Finder I receive the error "The action “Run Shell Script” encountered an error." Errors aren't an issue, I just need to know WHERE the log is for this error so I can correct it.

I've looked everywhere in all the logs that appear in the console application, and it doesn't appear to actually be logging the error. Where can I get the logging information for error that has occurred?


MacBook Pro, Mac OS X (10.5.2)
  • Barney-15E Level 8 Level 8 (44,250 points)
    Unless you added any logging items to your script, I don't think you'll find anything.
    However, that sounds like you are referencing items that only exist in the Automator context. Once it is run stand-alone, it no longer has the Automator shell around it.

    You can step through the program in Automator. If it is a Service that acts on Files and Folder, you'll have to add a Get Specified Finder Items as the first step temporarily. I haven't used python, but when an Applescript is there, when you get to the Applescript action in Automator, you can click the "play" button and it gives you more information on what fails than just stepping into the action.

    Another guess is that it might not be receiving the same type of object in the workflow that you are passing in the shell. Is it a Run Shell Script action? If so, how are you passing the items: stdin or arguments? How does your script reference them?
  • tnine Level 1 Level 1 (0 points)
    Hey Barney,
    My first step is simply to get the selected finder items, then pass them as arguments to my python script. All selected finder items are sent as arguments to my script. What's even more frustrating is everything works as it should, then I receive the error after my script has completed executing.
  • Barney-15E Level 8 Level 8 (44,250 points)
    Is it a Service or a plain workflow.
    If it is a service, then it is likely sending the same files twice if you have a Get selected finder items.
    The Service itself gets what is selected when you select it. If you then add Get selected Finder items, it gets them again, so it is passing them twice.