I have a shell script that I want to run from the scripts menu in the menu bar. (This is the menu that you can activate in the Script Editor preferences.) The script works when I run it from Terminal, but doesn't work when I run it from the scripts menu. To debug the problem, I'd like to see what error messages it's printing to the console — but I can't find the console output.
I haven't been able to find any output from my script anywhere in the Console app. Is there somewhere else I should be looking?
Best Answer
Here is an example.
Below is the text for my shell script named
hither.sh
. As you might guess, filenonexistant_file
does not exist.The
hither.sh
file is stored in my Documents folder. This is~/Documents
. The AppleScript I created is shown below.I saved this AppleScript to the file
~/Library/Scripts/hithere.scpt
. When I run this AppleScript from the menu bar, the shell script console output and error text is redirected to the~/Documents/hithere.txt
file. Below is the resulting output.