open URL in browser

Discussion in 'Mac Programming' started by McBgnr, Jun 1, 2009.

  1. macrumors regular

    #1
    Hello,

    I am using the following code to open URL in the browser:
    Code:
    [[NSWorkspace sharedWorkspace] openURL:LinkURL];
    
    I was assuming that this will open the URL in Safari, but I just realized that it opens the URL in default browser.

    So now how can I open the URL in a specific browser say "FireFox" when it is not the default browser. We have the terminal command open -a to open file in specific browsers. So an option is to run the command using NSTask. Was just wondering if there is any other option to do so.

    On another note, I am interested in knowing the place where Mac maintains the name of the default browser?
     
  2. Moderator

    robbieduncan

    Staff Member

    #2
  3. macrumors regular

    #3
    I was able to open URL in specified browser. Thanks a bunch for the helpful links.
     

Share This Page