Opening a remote Firefox window

Posted:
in Genius Bar edited January 2014
Hey guys,



Anyone know how to open a new Firefox window from the commandline? On linux, you'd just go "firefox http://www.appleinsider.com" and if firefox is already running, you'd just get a new window.



Can't figure out how to do that on OS X. If you run /Applications/whatever/firefox it opens a new firefox session. I've seen some documentation saying to use the "run-mozilla" script, but that's missing form the OS X distribution.



Anyone?

Comments

  • Reply 1 of 2
    allinoneallinone Posts: 279member
    Quote:

    Originally posted by jethro1138

    Hey guys,



    Anyone know how to open a new Firefox window from the commandline? On linux, you'd just go "firefox http://www.appleinsider.com" and if firefox is already running, you'd just get a new window.



    Can't figure out how to do that on OS X. If you run /Applications/whatever/firefox it opens a new firefox session. I've seen some documentation saying to use the "run-mozilla" script, but that's missing form the OS X distribution.



    Anyone?






    Well you can do it in AppleScript. And if you can do it in AppleScript you can do it in Terminal...



    This works for me in Tiger:



    Paste the following code into terminal and hit return:



    osascript -l AppleScript -e 'tell application "Firefox"' -e 'OpenURL "http://appleinsider.com"' -e 'end tell'





    Some documentation:



    apple's man page



    A macosX hints article





    Hope this helps!
  • Reply 2 of 2
    jethro1138jethro1138 Posts: 104member
    Quote:

    Originally posted by AllInOne

    osascript -l AppleScript -e 'tell application "Firefox"' -e 'OpenURL "http://appleinsider.com"' -e 'end tell'



    Excellent! That works fantastically. Thank you very much!
Sign In or Register to comment.