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?
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.
-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
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.
pid
with AppleScript but it's something I'm not familiar with.