Play a sound when AppleScript is done

user3261383 picture user3261383 · Feb 1, 2014 · Viewed 13.6k times · Source

I have no idea how to use AppleScript, how I got my little bash script working in the first place was beyond me. I'm currently using an AppleScript to run my bash script and it works fantastically. It is below.

do shell script "/Users/john/Scripts/screenshot -i --delete"

Now the bash script its referring to is that it will take a screenshot and upload it to my server, however;

I want it to play a sound when its done, how can I go about doing this? AppleScript is beyond my knowledge...

Answer

adamh picture adamh · Feb 1, 2014

You can use afplay :

do shell script "afplay /Users/john/Sounds/vengabus.aiff"

or i like to use text to speech:

say "Finished!"