Automator Results Display Question
I'm hoping someone here might be able to help me out. I've spent the last 2 hours searching the web for an answer but have not been able to find anything - so any help is much appreciated!
I have created a shell script (based on info i've found on the net) within automator that looks like the following:
----
#!/bin/sh
SERVICE='<Program Name>'
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE is running, shutting it down..."
osascript -e "tell application \"<Program Name>\" to quit"
sleep 30
else
echo "$SERVICE is not currently running - Starting <Program Name>!"
open -a "<Program Name>.app"
fi
-----
Effectively, it will launch said application if it is not running, or inversely will shut it down if it finds that it is running. That works all fine and dandy (and I eventually intend to use it on a remote machine to stop and start an app). But my problem lies in knowing if it successfully worked...
You see, when the workflow is saved as an application and executed I can confirm it is working (I see the application closing/launching in the dock), but I really would like to have a dialog box appear showing me the results of running the command, since I will be eventually executing this on another mac remotely.
I heard it is possible to take the results of a given action in workflow and pass it to an applescript (which as a result will display an alert dialog box with that info that was passed on to it). What would be the code to accomplish this? Also, all I need to see is an "OK" button to close the window after i've seen the results.
Hopefully this makes sense... Let me know if you need any more info.