10.4: Stagger startup items for less system impact
Jul 18, '06 07:30:00AM
Contributed by: Timmargh
I don't know about you, but whenever I start/restart my Mac, I hate the way that when it's reached the Desktop, it tries to launch all the start-up items at the same time. Then the hard drive starts whirring like mad, hopping back and forth and splitting its time between each app. Some of my menu bar items that launch at start-up are standard apps, i.e. non-system stuff, so I tried altering the way they launch by delaying them for a certain amount of time to allow other stuff to start first.
Read on for my solutions, one using Automator and the other using AppleScript.
The first thing to do was to identify which of my login apps could be launched manually. Taking my menu bar as an example, I have 13 items:
- Quicksilver
- Proxi
- iScrobbler
- AirClick
- Synergy
- Salling Clicker
- MenuCalendarClock
- AppleScript menu
- Bluetooth
- AirPort
- System volume
- Fast user switch
- Spotlight
Numbers 8 to 13 are system items, and numbers 5 and 6 are System Preferences panes -- none of these, as far as I know, can be launched individually. Number 7 automatically adds itself to the System Preferences -> Account -> Login Items list when it's launched, so we can forget that one, too. This leaves us with numbers 1 through 4, all of which can be started manually and told not to start at login ... which is what we need to do next: this is either done within the app's preferences (usually a 'Start at login' checkbox or something similar) or by deleting its entry in the System Preferences -> Account -> Login Items list.
I figured I could use Automator to do what I wanted but, for those of your who prefer it, I also did it using AppleScript.
Automator method
This is a relatively easy workflow to create -- the Pause action can be found in the Automator Library, and the Launch Application action resides in the Finder library:
- Pause: 20 seconds
- Launch Application: AirClick
- Pause: 2 seconds
- Launch Application: iScrobbler
- Pause: 2 seconds
- Launch Application: Proxi
- Pause: 2 seconds
- Launch Application: Quicksilver
AppleScript method
Fire up Script Editor (usually located in Applications -> AppleScript) and enter something like:
delay 20
tell application "AirClick"
launch
end tell
delay 2
tell application "iScrobbler"
launch
end tell
delay 2
tell application "Proxi"
launch
end tell
delay 2
tell application "Quicksilver"
launch
end tell
The delay command tells it to wait for that many seconds and the tell application "..." - launch - end tell bit launches the specified app -- pretty simple stuff.
Both methods
Change the app names to suit your setup, and experiment with the delays that work best for you. Presumably Macs that are newer and faster than my iMac G4 will be more suited to shorter delays. Select File -> Save As..., give it a suitable name and location, and make sure you change the File Format to Application.
Starting the, erm, delayed start
Finally we need to add our workflow or script to our login items: go to System Preferences -> Account -> Login Items, click the plus button, navigate to wherever you saved your workflow or script, select it, and click Add. And now you can restart your Mac to try it out.
[robg adds: We have a much older hint that has an AppleScript to work around what was then a bug in OS X's login routine; presumably a variation of that script would still work today.]
Comments (15)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060717092834812