Apple - Show Results of Automator-Terminal command

If you only have a few lines of output, you'd want to assign it to a variable and then display a confirmation dialog showing the output.

  1. add Action "Set Value of Variable"
  2. enter a new variable, e.g. output
  3. add Action "Ask for Confirmation"
  4. in the message field, enter the variable name declared above. While typing the variable name, Automator will suggest to complete the variable name. Accept by pressing Enter key. This prevents Automator from interpreting the variable name as a plain text message.

This will look like this: Automator with text output

NB: I also tried the $1 approach, but did not succeed.

If you have a lot of lines of output, you should direct all output into a new TextEdit document. To do so, just add the "New TextEdit Document" Action after your script action.

This may look like this: New Text Edit document action

Hint: diagnostic messages are often output to standard error. To also collect text send to standard error, add exec 2>&1 at the top of your bash script.


There are a couple of ways you could do this:

  • Adding an Ask for Confirmation action after the Run Shell Script one and using $1 in the message field.
  • Adding another Run Shell Script and executing osascript -e 'tell app "System Events" to display dialog "$1"'. You'll have to select as argument on the pass input drop down.