When I log into my user account on my PowerBook, everything stops for a few minutes. Drops of rain stop in mid-air, the wind falls still, the clock stops ticking, and my cat stops preening himself. I’m tired of this.

Spurred on by these hints, I finally got around to do something about it. I created a folder, ~/Library/Login Items/, dropped aliases to applications formerly in my (very lengthy) list of regular login items, and removed them from the OS’s list. Then I saved the following script as Slow Launch.app in that same directory:

-- Delay before the first launch and between subsequent launches
set firstLaunchDelay to 10
set interLaunchDelay to 5
 
tell application "Finder"
	-- Find my list of launch items
	set loginItemsFolder to (container of (path to me) as alias)
	set loginItemsList to loginItemsFolder's items whose kind is "Alias"
 
	-- Set the initial delay
	set launchDelay to firstLaunchDelay
 
	-- Process the list
	repeat with loginItem in loginItemsList
		-- Hurry up and wait
		delay launchDelay
		set launchDelay to interLaunchDelay
 
		-- Open the item; hide it if requested
		open loginItem
		if (loginItem's comment is "hide") then
			delay launchDelay
			set launchDelay to 0
			set (process ( (loginItem's displayed name) as text) )'s visible to false
		end if
	end repeat
end tell

Add Slow Launch.app to the OS’s login items list, and I’m done. I could swear that it even takes less time to launch everything, in spite of all the waiting the script does. The only drawback is that not everything can taken out of the OS’s list; some apps1 helpfully put themselves back again if you take them off the list, and others2 nag you about not being in that list whenever they’re launched. All that being said, it still feels a lot snappier this way.

  1. Witch, for example []
  2. Slim Battery Monitor, for example []

AppleScript, Code | Permalink | No Comments