vote up 2 vote down
star
1

I'm currently using scp from Terminal of Mac OS X. I would like to add sound notification when a transfer has been completed. I usually browse the web (NullPointer.ph FTW!) while copying files and would like to be reminded that I have work to do when the scp task is done so this sound notification will really be a pretty useful feature for me. Any ideas on the best way to accomplish this?

Thanks.

flag

1 Answer

vote up 5 vote down
check

The easiest thing I could think of was:

scp source dest && say "SCP is done"

If you want to play a particular a WAV or MP3 file, you could write an AppleScript to open and play the sound file using Quicktime or Play Sound then use the osascript command in place of the say command above to execute your script.

For example:

scp source dest && osascript -e "tell application \"QuickTime Player\"
open \"/System/Library/Sounds/Glass.aiff\"
play document 1
end"

Of course, you can also save the script to a file and run it from there.

link|flag
2 
wouldn't it be something like (for reliability): scp source dest && some_audio_player some_audio.aac – Dexter T. Feb 4 at 7:09
yeah, was thinking maybe use that instead, thanks. – Alistair A. Israel Feb 4 at 7:15
Works great! Thanks Alistair. I decided to go with the say "something" approach. Simple yet very useful. – paul_sns Feb 4 at 8:36
3 
Wow, there's even an option to change the voice using the -v [name of the voice] switch. Taken from: gabrielserafini.com/archives/2008/08/19/… – paul_sns Feb 4 at 8:43

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.