Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create an Automator app to include a workflow that will play a sound in a loop preceded by a 1 min pause. I want to do this without using elements from the "actions" library, but writing this part entirely in the "Run Shell Script".

So far I learned how to make the machine play the sound, but what will be the additional code to make it stop for "n" time and loop?

This is the current Automator workflow:

enter image description here

share|improve this question
up vote 2 down vote accepted
while :
    afplay "/Users/username/Library/Application Support/Nada/bell.mp3"
    sleep 60

If you want to do the same on one line in Terminal:

while :; do afplay "/Users/username/Library/Application Support/Nada/bell.mp3"; done
share|improve this answer
Wow! Thank you very much! That works wonderfully. – pause-n-loop Aug 3 '11 at 2:17
No problem! Don't forget to mark the answer as accepted if this fixed the issue. – Wuffers Aug 3 '11 at 2:30
Hi: I'm trying to do something different for the small app I want to make by putting the code in "Terminal" like this: << while : do afplay "Users/user/Library/Application Support/Nada/bell.mp3" sleep 60 done >> (w/o the arrows and all in one line), but it won't work. I wonder why? Is it possible in Terminal? Should I look for another programing language? ____ P.S.: I tried to switch the pic above for privacy reasons but the site won't allow me to post imgs. I'm sorry about that. I posted link to new image though. Thanks. – pause-n-loop Aug 3 '11 at 13:03
@pause-n-loop: Open a new question. Don't post a separate question in a comment. – Wuffers Aug 3 '11 at 14:24
but I'll answer your second question, you have to do this: while :; do afplay "..."; done – Wuffers Aug 3 '11 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .