vote up 1 vote down star

I am rather OCD and like my icons in a particular order.

I can just hold command + to move and change the order of apple icons in the menu bar but that does not work for the other icons.

I realize that these show up in the menu bar in the order they run but I have a certain number of apps that I would like to run on start-up and one icon (little snitch) isn't even listed as a start-up item.

Anyone have any ideas?

OSX 10.6.2

Edit:

Is it possible to write some sort of script that runs on login? Similar to a Windows batch file. Not sure how to do this on the Mac side.

The batch file would run the program I wanted farthest right, wait 10 seconds and run the program I wanted in the next position and so on.

Any Mac experts know how this would be done?

flag

76% accept rate

4 Answers

vote up 2 vote down check

I can answer the part about launching applications in order when you log in: first, open AppleScript Editor and create a script along these lines:

tell application "Address Book" to activate
delay 10
tell application "Chess" to activate

(for whatever programs you actually want to launch). Save this script as an Application (the default is to save as a script, in which case it'll open in the editor rather than running). Then open System Preferences, Accounts pane, select your account, select the Login Items tab, and drag the script into the item list. That should do it.

link|flag
That's fantastic, was thinking I'm surprised no one has yet wrote a helper app to help with reordering. So awesome we're finally getting all the solutions in one place. :) – Matt Gardner Nov 13 at 14:42
Many thanks - Just what I was looking for. Applescript seems like it would be a valuable thing to know. – CT Nov 13 at 19:31
vote up 3 vote down

That's up to the people that made the applications to enable the command-drag functionality. For example, iStat meters, a very popular set of menubar status meters, have full command-drag functionality.

If you can't do it, it's likely because the app developers did not properly implement that functionality.

link|flag
Actually, it's because Apple doesn't allow third-party developers to implement that functionality. – NSD Nov 15 at 18:13
Actually, NSD, that's not true. You are absolutely "allowed" to implement that functionality, Apple just doesn't open up the code that they use for built in MenuExtras. You can certainly implement it yourself (and I have). – phoebus Nov 15 at 19:34
Let's see what you've implemented. – NSD Nov 15 at 22:39
And don't say iStat Menus because that product very clearly uses MenuCracker to hack its way into private SPIs. – NSD Nov 15 at 22:46
There is nothing "against the rules" about implementing the menuitem dragging...unless you'd like to cite your source? – phoebus Nov 15 at 23:29
show 1 more comment
vote up 1 vote down

Short Answer

Unfortunately Apple has yet to enable drag and drop functionality of third-party menubar icons. Without preferences being provided by the developer, the only way to reorder them is by opening the apps in a specific order, where those opened first will appear to the right. On occasion some vendors write code that forces the icon to appear at one end or the other, giving you zero control over its position.

Long Answer

There are two types of icons in the OS X menu bar:

  • MenuExtra: Apple's private class to develop their own menu icons.
  • StatusItem: A class provided for third-party developers to create menu icons.

MenuExtras

Apple's private class have a number of built-in perks, including:

  • If you double-click them (in the finder) they will load in the menubar and open automatically at login.
  • You can command-click them (in the menubar) and drag to reorder them.
  • To remove them you can command-click and drag them off the bar (similar to dock items).

Unfortunately Apple doesn't officially sanction the development of 3rd-party MenuExtras. The reason given is that they operate as plugins in the SystemUIServer and faulty code could cause instability in a core part of the operating system.

StatusItems

The class for developers doesn't provide such functionality out of the box (as of 10.6 Snow Leopard) and unfortunately there are currently no open source classes that permit commercial use.

Thus, developers typically do the following, in order of general occurrence:

  • Ignore the issue all together
  • Force a preset position
  • Provide a few basic preferences; or
  • Must write their own classes to duplicate the MenuExtra functionality

For a list of available MenuExtras, navigate in the Finder to:

/System/Library/CoreServices/Menu Extras

For a well kept list of free and commercial StatusItems, visit:

Super OS X menubar items

Hope this helps. :) M

link|flag
vote up 0 vote down

I don't think you can do that, at least not without some hacking. I know that some apps that have menubar icons have options in the preferences on whether they appear closer to the left or to the right side. Other than than, dunno what else I can say but good luck!

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.