Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use iTunes visuals as a screen saver Apps
I have never been one for screen savers, however I've recently found one that I like quite a bit. Using a little thing called ScriptSaver (previously used in this hint), which runs an AppleScript of your choice when your screen saver would activate, I wrote a short AppleScript to start up iTunes visualization if a song is playing. This could be extended to do a plethora of things, such as start a specific playlist if nothing was playing, or play a random song, etc. But as I said, I don't like screen savers much, so I only want it to come on if I'm listening to music but not using my machine. For that, this is perfect.

tell application "iTunes"
  if player state is playing then
    set full screen to true
    set visuals enabled to true
  end if
end tell
[robg adds: This worked fine on my machine; if you have more than one display, the visuals will play on the monitor that holds the iTunes window.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[31,532 views]  

Use iTunes visuals as a screen saver | 12 comments | Create New Account
Click here to return to the 'Use iTunes visuals as a screen saver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why not help scientists fold proteins instead?
Authored by: Lectrick on Feb 11, '04 11:39:50AM
Your idle CPU cycles are better utilized trying to find cures for diseases that people are actually dying from, than making your music look pretty. Get a folding@home screen saver and pitch in! (and feel free to join team 2402)

http://folding.stanford.edu/

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]

Why not help scientists fold proteins instead?
Authored by: valx on Feb 11, '04 03:33:43PM

Thanks for telling people what is good for them. Maybe instead of doing whatever it is you do in your free time, you should do volunteer work for the organization of my choosing.



[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: jonbauman on Feb 11, '04 01:41:03PM

If iTunes isn't playing anything, the above script will just go to a black screen. In order to use a regular screen saver in that event, you can use the following modified script.

property theModule : "Random"

tell application "iTunes"
	if player state is playing then
		set full screen to true
		set visuals enabled to true
	else
		do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module \"" & theModule & "\""
	end if
	
end tell

I've set the module to Random, but you can easily replace that with the name of any installed module you like (e.g. "Flurry").

---

jon

[ Reply to This | # ]

Use iTunes visuals as a screen saver
Authored by: raggamuffin on Feb 12, '04 07:22:29PM

Excellent little hack, makes screensavers more interesting. However, there's one function missing - if it's showing the iTunes visualiser, it won't turn off with a simple movement of the mouse, it needs a click or a keypress (usually I press space, but that just pauses iTunes, which is a bit annoying). I'm a bit new to this AppleScript malarkey, but is there some workaround that could deactivate the visualiser when the mouse is moved?



[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: josh doubles on Feb 12, '04 08:42:48PM
I love the improvement but I noticed, with all these scripts, that if iTunes is not running it will be launched when the screen saver turns on.

I am a complete AppleScript novice but I devised this solution:


property theModule : "Cubes"
property okflag : false

tell application "System Events"
	if (get name of every process) contains "iTunes" then set okflag to true
end tell

if okflag then
	tell application "iTunes"
		if player state is playing then
			set full screen to true
			set visuals enabled to true
		else
			set okflag to false
		end if
	end tell
end if

if okflag is false then do shell script "/System/Library/Frameworks/
ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/
MacOS/ScreenSaverEngine -module \"" & theModule & "\""

Now you dont have to wonder why iTunes is always running. Enjoy!

[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: nerdtech on Feb 13, '04 11:49:05AM
This worked great - except you need to edit one line in your script:
if okflag then
actually needs to be...
if okflag is true then
Otherwise, it was still launching iTunes, if it was not currently opened. With that edit, I have a new screen-saver! Thanks!

[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: Sesquipedalian on Apr 06, '09 08:38:27PM

For people finding this hint through search engines:

All that is needed is to add a check to see if iTunes is running, and an activate line at the appropriate spot. There is no need for the shell script.



[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: mark hunte on Feb 11, '04 03:33:40PM
Thanks for the tip. I was trying to work out how to do this a while back. but could not find a way to activate my script as a screensaver. (was waiting for G-Force website to give me some clues as promised. But the "scriptsaver" does the trick.
I've used your

set full screen to true
set visuals enabled to true"
which is much simpler than my original
click menu item "Turn Visualizer On" of menu "Visualizer" of menu bar 1
Also set the iTunes window to minimize so its not in the way when I want to use the Mac. You will need to be running system events ( jaguar ) GUI scripting (panther) to run this script ( below )
tell application "iTunes"
	activate
	 
 end tell
 	 tell application "System Events"
		 
		tell process "iTunes"
			 click menu item "Minimize" of menu 
		"window" of menu bar 1
			
	end tell
		tell application "iTunes"
			set full screen to true
		set visuals enabled to true
			
	end tell
    end tell

---
mh

[ Reply to This | # ]

Use iTunes visuals as a screen saver
Authored by: psycopath on Oct 15, '04 12:18:39AM

This is awesome, except it doesn't really accomplish my screensaver's objective - quick protection of my computer. Screensaver password protection doesn't work.

The only thing I can think of to remedy this is to create a script that waits for you to close the visualizer, and then runs a blank screensaver once you do. It would be a hassle, but it would serve my purpose.

Unfortunately, I have absolutely no idea how to do this with applescript, if it can be done at all.

Any ideas?

thanks,
PP



[ Reply to This | # ]
Unable to Trigger Quartz Composer Modules
Authored by: acenright on Jan 27, '07 08:17:04AM

All,

Thank you for the script variants above, they work mostly as descibed. I can finally use an iTunes visualizer as my screen saver when iTunes is currently playing and use another screensaver when it's not.

Problem is, I cannot choose to use a quartz composition as the non-visualizer screensaver. The script breaks, resulting in some weird screen flicker and then nothing.

This is particularly frustrating, as I have created a couple of custom RSS screensavers using Quartz Composer that I'm dying to display using a modified version of the scripts here.

Does anyone know how to modify it? I assume there needs to be a change to this chunk:

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module \"" & theModule & "\""

Thanks in advance!

A.



[ Reply to This | # ]
Unable to Trigger Quartz Composer Modules
Authored by: acenright on Jan 27, '07 08:40:54AM

Actually, after some additional testing, it seems the issue could be intel-related. Has anyone had success using these scripts on an intel-Mac?

A.



[ Reply to This | # ]
Use iTunes visuals as a screen saver
Authored by: Sesquipedalian on Apr 06, '09 08:30:55PM
An update for Mac OS X 10.5, iTunes 8.1, and ScriptSaver 2.10:

The original script will result in the normal screen saver specified in ScriptSaver's options running over top of the iTunes visualizer. To fix this, add an activate line to the script, like so:

tell application "System Events"
	if (get name of every process) contains "iTunes" then

		tell application "iTunes"
			activate
			if player state is playing then
				set full screen to true
				set visuals enabled to true
			end if
		end tell

	end if
end tell
Note that this also includes a check to see if iTunes is running before trying to do anything with it.

In ScriptSaver's options, put this script in the Activation Script setting, and then in the Screen Saver setting select the screen saver that you want to run when iTunes is not playing.

[ Reply to This | # ]