I made this script to work with ‘ScriptSaver’ in order to launch the iTunes visualizer ONLY if iTunes is already launched and playing.
I inserted an “if” statement to check if iTunes is already active, but this script launches iTunes anyway. Why?
Is there a way to NOT have iTunes launch if it isn’t already launched?
here’s the script…
property theModule : "ElectricSheep"
tell application "System Events"
set allAppList to name of (application processes) as string
--set front_app to name of (item 1 of (get processes whose frontmost = true)) as string
end tell
if "iTunes" is in allAppList then
tell application "iTunes"
if player state is playing then
set full screen to true
set visuals enabled to true
tell application "ScreenSaverEngine"
quit
end tell
end if
if player state is not playing then
do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module \"" & theModule & "\""
end if
end tell
end if
Browser: Firefox 2.0.0.8
Operating System: Mac OS X (10.3.9)