Q: Using Automator to gradually increase volume
I want to create an Automator iCal script that plays my favorite Sunday morning internet radio cast (the great jazz on WHPK-FM Chicago), starting with zero volume and rising to my normal volume listening level over five minutes. I can't figure out how to set a volume variable.
I found this conversation, but adding
for((i=0;i<50;i++)); do
osascript -e "set volume output volume $i"
done
into a Run Applescript window returned a "The workflow has stopped because an error occurred while converting the data" error.
This was my first attempt at using Applescript, so I could have that completely wrong.
Any suggestions or corrections? I'd love to be wakened gradually Sunday mornings to my favorite broadcast. I'm running the latest version of iTunes, OSX and Automator.
Thanks
MacBook Air, Mac OS X (10.7)
Posted on Jan 22, 2012 11:56 AM
Thanks, Red.
I figured out the problem: your script adjusted output volume, not iTunes volume. I did a little searching and adjusted to script to tell iTunes to change the volume:
on run {input, parameters}
tell application "iTunes"
set the sound volume to 5 -- set initial volume
set desiredVolume to 50 -- set to regular listening level
set interval to (3.5 * minutes) -- start to finish time
set waitTime to interval div desiredVolume -- spread out over interval time
repeat with X from 1 to desiredVolume
set the sound volume to X
delay waitTime
end repeat
end tell
return input
end run
That works just dandy. Now I can attach it to iCal and enjoy my Sunday jazz. ¡Mucho gracías!
Posted on Jan 22, 2012 2:24 PM
