Muffinresearch Labs by Stuart Colville

mac tip: Lock screen and pause iTunes | Comments (1)

Posted in Apple, Code on 24th April 2008, 12:09 am by Stuart

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.

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

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

Post Tools

Comments: Add yours

1. On October 22nd, 2009 at 4:23 pm Ubuntu: Lock Screen and Pause Spotify by Stuart Colville said:

[...] When I used a mac I had a shonky little applescript to pause iTunes when I locked the screen. [...]







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.636s.