mac tip: Lock screen and pause iTunes

In the past I've used a specific app that allowed configuration of a keystroke to lock my screen but in setting up a new machine I thought I really want to add the ability to pause iTunes as well as locking the screen. The locking part is caused by having the screen saver set up to lock the screen - this is set in security preferences. To make this all happen just requires the following noddy applescript.

	do shell script "killall -s iTunes"
	tell application "iTunes"
	end tell
end try
do shell script "open '/System/Library/Frameworks/ScreenSaver.framework/Resources/'"

To get the keystroke configured I'm using quicksilver triggers (to do this you'll need quicksilver installed), first put the script above into script editor, save as an application bundle the the location of your choice and then point a trigger to that app file and define your keystroke. I also set the scope to all applications. Done!

Update: Added a dirty little try catch to only run the pause when iTunes is open

Show Comments