Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 down vote accepted
while :
do
    afplay "/Users/username/Library/Application Support/Nada/bell.mp3"
    sleep 60
done

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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