Is there a way to display messages to the MAC desktop from a BASH script? I am writing a terminal window script, that needs to display a message on the MAC desktop. Also if the was a way to open a message box from a BASH script.
Dennis
Is there a way to display messages to the MAC desktop from a BASH script? I am writing a terminal window script, that needs to display a message on the MAC desktop. Also if the was a way to open a message box from a BASH script.
Dennis
Like this:
#!/bin/bash osascript -e 'Tell application "System Events" to display dialog "Some Funky Message"' 
Or, if you want the user to input something and get the result...
#!/bin/bash input=$(osascript -e 'Tell application "System Events" to display dialog "Enter something:" default answer ""' -e 'text returned of result' 2>/dev/null) echo $input 
And, to anticipate your next question, if you want bash variables in the dialog box and also quotes and stuff, you can use this form of sending the script into osascript on its stdin:
#!/bin/bash var=7 input=$(osascript <<EOF Tell application "System Events" to display dialog "Steve's Funky Message ($var) with apostrophe and variable" EOF) 