2015-01-02, 20:57
Can someone help please with the following .sh script:
This one worked with the original callbacks 0.5 but not with callbacks2. I get the following errors:
Code:
#!/bin/bash
/usr/bin/osascript <<-EOF
tell application "System Events"
if process "iTunes" exists then
set okflag to true --iTunes is running
else
set okflag to false
end if
end tell
if okflag is true then
tell application "iTunes"
set currentvolume to the sound volume
if player state is playing then
repeat
--Fade down
repeat with i from currentvolume to 0 by -1 --try by -4 on slower Macs
set the sound volume to i
delay 0.01 -- Adjust this to change fadeout duration (delete this line on slower Macs)
end repeat
pause
--Restore original volume
set the sound volume to currentvolume
exit repeat
end repeat
else -- if player state is paused then
set the sound volume to 0 --2007-03-20 script update to fix startup glitch
play
-- tell application "System Events" to set visible of process "iTunes" to false
-- reveal current track
repeat with j from 0 to currentvolume by 1 --try by 4 on slower Macs
set the sound volume to j
delay 0.01 -- Adjust this to change fadeout duration (delete this line on slower Macs)
end repeat
end if
end tell
end if
EOF
This one worked with the original callbacks 0.5 but not with callbacks2. I get the following errors: