Home > Macintosh, Web Stuff > Mac Magic: a Skulk of Firefoxes

Mac Magic: a Skulk of Firefoxes

May 6th, 2009

I recently started using the gmail interface for my work email.  Since it’s possible by default to run only one instance of Firefox on a Mac at a time, this left me unable to keep an eye on the gmail account that I use for professional development.  Doing this is easy enough in Windows using icons that launch different Firefox profiles, but the Mac solutions I found only taught me to create differing profiles, not how to launch them simultaneously. This post details how to create two or more Firefox profiles AND use them at the same time.  Each profile maintains different bookmarks, extensions and saved tabs.

Step 1: Create your second Firefox profile

In Terminal, type this command to bring up the Firefox Profile Manager:

/Applications/Firefox.app/Contents/MacOS/firefox-bin --profilemanager

Firefox Profile Manager

Firefox Profile Manager

Click the Create Profile… button to do just that.  Be sure to uncheck “Don’t ask at startup.”  This will allow you to use your regular Firefox icon (in your Applications folder) to launch the Profile Manager.

Step 2: Create scripts to launch each profile

Launch the Script Editor and paste this into a new script:

do shell script "/Applications/Firefox.app/Contents/MacOS/firefox -P profilename &> /dev/null &"

where profilename is the name of the second profile.

Save this as an Application Bundle in your Applications folder, or wherever you like to store applications.  When you save the bundle, be sure to uncheck the “Startup Screen” box, or the script will ask you what to do when you launch it.

Repeat this step to create an Application Bundle for your default profile, using this string:

do shell script "/Applications/Firefox.app/Contents/MacOS/firefox -P default &> /dev/null &"

Step 3 (optional): Assign an icon to your new application bundle

Like many things Mac, changing the icon of any file is easy and intuitive–once you know how it’s done.

  1. Find a file or application with the icon you wish to use and press Cmd+I to open its information pane.
  2. Click the icon in the top-left corner of the information pane.  It becomes highlighted.  Press Cmd+C to copy the icon to the clipboard.
  3. Find your application bundle and press Cmd+I to open its information pane.
  4. Click the icon in the top-left corner of the information pane. It becomes highlighted.  Press Cmd+V to paste the icon.
  5. Close both information panes.
non-highllighted icon

non-highllighted icon

highlighted icon

highlighted icon

Step 4: put your new Firefox icons on your desktop, in your dock, or your favorite place to launch applications.

Extra credit:  Install Quicksilver and launch your custom Firefox icons from the keyboard.

Other tips:

  1. I initially used the bitsy Firefox as the icon picture on both profiles.  This quickly became confusing but was easily remedied.
  2. Once any Firefox profile is launched, you will not be able to launch another instance unless you have an Application Bundle that launches a different profile.  Be aware that if you launch plain vanilla Firefox you’ll get warned that Firefox is already running.  This makes the two Application Bundles necessary.

The tangled web I wove: This Lifehacker post on the topic is what set me down this path.  Along the way, I finally ran across a MacRumors thread that gets the scripting syntax right.  Now, if only I’d run across Asa Dotzler’s post on this same topic, I could have spent a few hours on Sunday doing something else, but feeling much less accomplished.

Update on an observed quirk: I added icons to my dock to launch my custom Application Bundles, but they behave weirdly.  When they are launched, their respective dock icons do not have the dot next to them, indicating that they are running.  There are, however, two additional Firefox icons at the bottom (dock is at left).  These icons do have the “I’m running” dot.  Huh.

  1. October 4th, 2009 at 15:17 | #1

    No idea. This worked for me under Leopard. If you’re using an OS other than Leopard, it may not work.

  2. Ole
    September 29th, 2009 at 00:26 | #2

    Thanks, this is a fantastic solution. However, when I go to create the application bundle I get the following error message: “Expected string but found end of script.” What am I doing wrong?

    Many thanks


  3. June 17th, 2009 at 07:02 | #3

    As far as I can tell, the icons in the Applications folder or that you drag to the Dock stay customized; however, if you launch an application with a customized icon, it is represented in your dock on the far right (or bottom) with the standard Firefox icon. This could be confusing if you use the Dock to switch between your instances of Firefox. Clicking the customized icon in the Dock again tries to launch the app again, which doesn’t work, and it’s not clear which standard Firefox icon in the Dock is the one that you’re after.

    I always use Cmd+Tab to switch between apps, and all the icons there are the standard Firefox icons, too. I do sometimes switch back to the wrong one, but I guess I’ve gotten used to it.

    Sorry I can’t help… :(

  4. Tony
    June 17th, 2009 at 01:38 | #4

    Thx for the article, although i couldnt get the icon to work properly. i changed the icon for the app script but once the script launches your firefox profile then the icon changes back to the standard firefox icon? am i missing something here. i would like to use a different icon for each profile. is this possilbe?

  5. May 7th, 2009 at 07:28 | #5

    That’s a perfectly fair question, Steve. The biggest reason is that I like to use the keyboard to switch tabs. In Firefox, you can move to the first tab by pressing Cmd+1, second by Cmd+2, and so on. It only goes up to Cmd+9, but that key combo always moves to the tab on the far right. The keyboard shortcuts to move between Safari tabs are different, and require more fingers. Yes, I’m that lazy.

    Also, I love Firefox add-ons, which I can’t use in Safari (right?). I tried Flock, but it’s too busy and slow. Opera was ok, but it drew certain pages funny. I also tried the site-specific browser, Fluid, which was actually pretty great. In the end, Firefox won out.

  6. May 7th, 2009 at 00:53 | #6

    Forgive this question, but why not use Firefox for one profile and Safari for the other? I do this from time to time, mostly to log into my library’s Flickr/Yahoo! account without having to log out of my personal account.

Comments are closed.