Launching multiple Firefox profiles on OS X using applescript

Submitted by jeff on Sun, 12/25/2011 - 00:02

David asked me the other day to blog about my applescript hack for launching different Firefox profiles in separate processes. I consider this to be, at best, a hack, but it's a pretty productive hack, so here we go!

Step 1: create a new profile:

/Applications/Aurora.app/Contents/MacOS/firefox -ProfileManager

Just click on 'Create Profile', name the profile ( say, Firebug, for no particular reason ), and click ok. Make sure when you get back to the ProfileManager you select 'default' again:

Firefox will instead select the new profile, which is not what we want.

Step 2: create the applescript

Open the applescript editor and paste in this code:

do shell script "/Applications/Aurora.app/Contents/MacOS/firefox -P Firebug > /dev/null 2>&1 "

You'll note, this isn't really much applescript, what we're really doing is just shelling out to fire up Aurora.app and supply the correct argument for -P.

Step 3: create the .app bundle

In the applescript editor, select Edit / Save As and select 'Application' under the 'File format' drop list. This will create a .app bundle that acts just like any other OS X application. In particular, the name you gave it is nicely indexed by Spotlight, so you can launch it by triggering Spotlight ( or butler, or Quicksilver? ) and typing some fragment of the filename:

You should now be able to launch Aurora ( or whichever channel you pref ) running a specific profile by double-clicking on this .app. This isn't how I use it though, instead I tend to launch the .app via Spotlight:

Caveat: the one problem with this technique is that Firefox is launched dead-last in the applications list, so you will need to manually switch to it. It's slightly annoying, but I theorize that it is no less annoying than having to learn enough Applescript to work around it. I did look into this for a bit the other night with no luck. Patches / suggestions welcome!

0 comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Drupal theme by Kiwi Themes.