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:

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:

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.]

and if you can get your hands dirty with shell commands, you can use the following script without using delays:

open "/Applications/Mail.app" ; open "/Applications/Safari.app" ; open "/Applications/whatever.app"

Of course this is more complicated as you have to know the correct path for every application to start, but you can incorporate it in an AppleScript using the "do shell command" command. This method launches one app after the previous one finished launching, so no delay is necessary.

Et cetera. Note that sleep in the shell code replaces the delay in the Applescript, and that the three variants of the open command can all be used more or less interchangeably. The second version is usually shortest, but the short name for an app launched this way isn't always obvious, e.g. I think the Office programs all have slightly oddball short names, but off the top of my head I can't remember what they were, or how to look that string up. Using the other two versions is a little more typing, but it's guaranteed to work.

I don't put pause statements between the Automator actions because it's not necessary. When an application launches the action won't complete until the application is fully launched. The AppleScripts at the beginning and end are for activating Dashboard. Dashboard will activate and the apps will launch in the background. This allows me to see what the weather to doing for the day, what local gas prices are doing, etc. After everything is done Dashboard goes away and the system is ready to be used.

[...] numbers 5 and 6 are System Preferences panes -- none of these, as far as I know, can be launched individually

You have to lauch the helper apps contained in the preference pane bundle's "Resources" folder: SEC Helper.app and Synergy.app respectively. Additionally you have to disable "lauch at login" in the preference panes, so the helper apps don't get added to the list of login items (AFAIK this works for Synergy only).

I use this script doing almost the same by looping through an array, so it might be much easier to add and remove apps if you need to - just edit the list (appsToStart) at the start. Moreover it hides the apps after launching them so you don't end up with a cluttered desktop. (It even hides them more the the prefernce pane - on my system ;) Have fun.