Joris Kluivers

I like to build software.

Automator Command Line Utility Bug?

OS X comes with a commant line utility, /usr/bin/automator to execute Automator workflows from the command line. This is what man automator has to say:
automator -- runs an Automator workflow

automator document

automator runs the specified workflow document. To create or edit a
workflow, use the Automator application. There are no options.

Not very usefull. All we know now is how to specify which workflow we want to be run, no information on how to add input to the workflow, like a list of url’s or a list of files.

I created a simple test workflow that display’s two confirmation boxes. When the first one is dismissed with a negative response, the second one shouldn’t appear. This works fine in Automator, when run I am presented with a dialog, when I click OK I get to see the second dialog. But when I run the workflow using /usr/bin/automator I never see the second dialog.

Some research using strings /usr/bin/automator reveals the presence of applicationShouldTerminateAfterLastWindowClosed: So perhaps this selector causes /usr/bin/automator to terminate after a dialog is closed, even before the Automator action is completed succesfully.