Screensaver Background

Another interesting variation of the screensaver, as I’m sure has been mentioned before, is the background screensaver. This can be started with:

do shell script “/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background”

The problem is, I’m not sure how to get it to stop. I’m assuming it’s simply a matter of stopping the “do shell script” but I’m not quit sure how it’s done. The traditional applescript method of “tell application “ScreenSaverEngine” to quit” doesn’t seem to work because the screensaver is in the background. So, my question is:

  1. How do you stop the background screensaver?
  2. Is there any particular drawback or danger that one should be aware of before using the background screensaver?

Thank you for your time in reading this and any ideas would be appreciated.

bwDreams

thats cool

do shell script "killall ScreenSaverEngine"

also i noticed that if you set your screen saver to cosmos then invoke the background script
you can then go into the prefs and select cosmos > options then click ok and it will stop it

edit:
now i look at it if you click options for any screen saver it will stop it.
the command would be better invoked from terminal using

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &

as script editor hangs untill the process is killed

Dear Kim,

You’re right about the cool part. And thanks for the tip on the “sytem prefs - OK” approach for terminating it. It’s a shame that it hangs during execution. It would be so nice if the script continued so that you could start it and stop it from within the same application. If you come up with any more ideas please let me know.

Thanks again for the comments.

bwDreams

You may be interested in this (screensaver) thread: Killing unknown pid with AppleScript

Thank you Bruce. (I feel like I’m in a Monty Python skit) That is exactly what I/we were looking for. It’s perfect…I love it. (Sorry that I overlooked that posting and forced you to provide the link.)

By the way, do you know of a reason (besides distraction maybe) why someone might not be advised to continuously run the screensaver in the background like that?

Again, thank you for your time and input.

bwDreams

Found the right thread now? :wink:

You’re welcome; Don’t worry about it.

Performance, maybe.

Edit: The background process will be stopped if the screensaver is activated normally. This will cause a (benign) error message if you try to stop the non-existent background process. You should add a try block to the killall line:

		try
			do shell script "killall ScreenSaverEngine"
		end try

(I’ve added this to the orginal script too.)

You’re right about adding in the extra try block. The fewer error messages the better.

Again, thank you very much.

bwDreams