Alternative to Jiggler for Snow Leopard?

Hippo Man

Hippo Man
Does anyone know of an alternative to the Jiggler program that I can run under Snow Leopard? Jiggler doesn't work under that OS version yet.

For those of you who don't know what Jiggler does, it monitors the use of specific programs, and if they are running, it periodically "jiggles" the mouse so that the screen saver doesn't turn on. I have set it up to "jiggle" the mouse when QuickTime is running, so that I don't have to manually disable the screen saver when I'm watching videos with QuickTime.

My goal is to automatically disable the screen saver when QuickTime is running, and to have it automatically enabled under all other circumstances. I don't care whether or not this is accomplished via "jiggling", as long as I can automatically cause the screen saver to be disabled in some way or another under this condition.

By the way, I know that I can view videos via VLC, and that this program can be configured to disable the screen saver. However, there are a number of cases where I want to use QuickTime to view my videos.

Thanks in advance for any suggestions you might be able to offer me.
.​
 
Last edited:
A bunch of random sugestions about screen saver.
1. Set your screen saver delay for 1 or 2 hours (whatever is reasonable for your videos)
2. Set screen saver delay to 'Never', and set a screen corner to manually start screen saver whenever you want it.
3. Set a screen corner to 'disable screen saver' and use that as you begin watching a movie.
4. Do you really need screen saver? It's mostly for entertainment, unless you have it set so you need to enter password to leave the screen saver.
5. Have you checked with the site that does 'Jiggler' for possible updates or workarounds?
 
Thank you for your suggestions.

In reply to each of them ...

1. I want my screen saver to turn on after 3 minutes of idle time, except when QuickTime is running. 1-2 hours is too long.

2. I want my system to automatically detect when QuickTime is running so that I don't have to use any manual intervention to disable or re-enable the screen saver. Jiggler gives me this exact functionality.

3. Same answer as for number 2.

4. I love the entertainment value of my screensaver, and I have been able to fully enjoy it in exactly the way I want when using Jiggler.

5. They don't currently have any workarounds nor an ETA for Snow Leopard compatibility, which is why I posted my question here. I was hoping that perhaps someone knew of an alternative method for controlling my screensaver the way I want.

In summary, I'm looking for a way for my screensaver to kick in after 3 minutes of idle time unless QuickTime is running, and I don't want to have to take any manual action at all to make that happen.

Given that there doesn't seem to be an alternative to Jiggler, and since it's unknown as to when that program will run properly under Snow Leopard, I'm now in the process of writing an AppleScript solution.

I'll post it here whenever I get it working.
.​
 
Last edited:
OK. I have now written an AppleScript solution for this problem that I can use until Jiggler gets working under Snow Leopard, or until there is some other method I can use.

Note that this works under 10.5.8 and any other Leopard and Snow Leopard versions where the plist files in ~/Library/Preferences/ByHost have names that end with your machine's UUID. If you are using an older version of the OS (I'm not sure which), you will have to change the ssControl script (below) to use the machine's mac address as the suffix, instead. I'm leaving that task as an exercise for the reader. :)

Follow these steps:

1. Open a Terminal session

2. Issue this command:
Code:
mkdir ~/bin

3. Create a shell script called ~/bin/ssControl that looks like this. Carefully note the single quotes, double quotes, and back-quotes:
Code:
#!/bin/sh

[ $# -lt 1 ] && {
  echo "
usage: `basename $0` screensaver-idle-seconds

use 0 for the idle seconds to disable the screen saver
" 1>&2
  exit 1
}

idle="${1}"

# This assumes that the plist suffixes in ~/Library/Preferences/ByHost are
# the machine's UUID
suffix=`/usr/sbin/system_profiler | /usr/bin/egrep 'UUID' | /usr/bin/sed 's/^.* //'`
domain="ByHost/com.apple.screensaver.${suffix}"

/usr/bin/defaults write ${domain} idleTime -int ${idle}

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine &
pid=$!

# Adjust the sleep time so that your screen doesn't flicker when the
# ScreenSaverEngine starts and is quickly terminated. This number
# should be at least 0.10 seconds, and it should be as large as
# possible for the amount of flicker that you're willing to tolerate.
/bin/sleep 0.20

kill ${pid}

exit 0

4. Issue this command:
Code:
chmod +x ~/bin/ssControl

5. Open up the Script Editor

6. Create an AppleScript containing the following code. Set the pause to 1 or greater. Set ssIdle to your normal screen saver idle time in seconds:
Code:
set pause to 5 -- how long to wait between checks for QuickTime's status (in seconds)
set ssIdle to 180 -- screensaver timeout when not disabled (in seconds)

-- Don't change anything beyond this point
set ssOff to 0
set isRunning to false

repeat
	set idleTime to ""
	tell application "System Events"
		if (exists process "QuickTime Player") then
			if not isRunning then
				set idleTime to ssOff
			end if
			set isRunning to true
		else
			if isRunning then
				set idleTime to ssIdle
			end if
			set isRunning to false
		end if
	end tell
	if not (idleTime = "") then
		ssControl(idleTime)
	end if
	delay pause
end repeat

on ssControl(idleTime)
	try
		do shell script "~/bin/ssControl " & idleTime
	on error m number n
		display dialog m buttons {"Cancel"} default button 1
	end try
end ssControl

7. Save this script under the name of your choice, and make sure it gets saved as an Application. I saved my version as SS-Monitor.app.

8. Go to System Preferences->Accounts->Login Items and put SS-Monitor.app (or whatver you named your own AppleScript) into the list of items that open automatically when you log in.

9. Log out and re-log in.

From this point forward, whenever you start up QuickTime, the screen saver will become disabled, and whenever QuickTime finishes, the screen saver will be re-enabled.
.​
 
Last edited:
Here's a more efficient version of the script. Also, I gave some of the variables more meaningful names.

Replace the script in step 6 with the following. Also, when saving the script as an Application in step 7, Stay Open now has to be checked.
Code:
property idlePause : 5 -- how long to wait between checks for QuickTime's status (in seconds)
property ssOn : 180 -- screensaver timeout when it is turned on (in seconds)

-- Don't change anything beyond this point
property ssOff : 0
property isRunning : false

on idle
	set ssTimeout to -1
	tell application "System Events"
		if (exists process "QuickTime Player") then
			if not isRunning then
				set ssTimeout to ssOff
			end if
			set isRunning to true
		else
			if isRunning then
				set ssTimeout to ssOn
			end if
			set isRunning to false
		end if
	end tell
	if ssTimeout ≥ 0 then
		ssControl(ssTimeout)
	end if
	return idlePause
end idle

on ssControl(timeoutValue)
	try
		do shell script "~/bin/ssControl " & timeoutValue
	on error m number n
		display dialog m buttons {"Cancel"} default button 1
	end try
end ssControl

.​
 
Last edited:
Last edited:
Back
Top