2

I start my firefox with a fixed profile from terminal using:

/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P UserName

It works nicely, but the focus is on Terminal and not on firefox.

Is there a way to change this?

2 Answers 2

5

You can use the following instead:

open -n /Applications/Firefox.app --args -no-remote -P UserName

-n means a new instance of the application is launched, even if there's already one open. Everything after --args is being passed on as arguments to the application.

1
  • -a can be used in place of -n. This will reuse the existing process, but will still bring the window to the front and give it focus. Apr 7, 2023 at 17:25
1

A kludgy hack would be to add the following after the command:

& osascript -e 'tell application "Firefox"' -e 'activate' -e 'end tell'

Or alternatively you could use open /Applications/Firefox.app if you don't need to specify the profile you want to use.

2
  • Thanks very much for your answer. I like the first hint. The problem is that I often already have firefox on when I run that command, and sometimes (I am not sure exactly when) it would focus on the running Firefox. Do you know a solution for this? Thanks again
    – mrw
    Aug 7, 2010 at 19:47
  • @Mr Woody: I'm not sure. Sorry. Maybe using the pid with AppleScript but it's something I'm not familiar with.
    – Chealion
    Aug 7, 2010 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .