Opening a web browser on a MAC

Hi,
this is the code I use to open a internet explorer window at the approiate address in my programme when running on a PC.
//Method that opens an explorer window at the relevant address
public void openBrowse()
String cmdlocation ="c:\\program files\\internet explorer\\iexplore.exe";
site = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide";
String gweb = cmdlocation + " " + site;
try
Runtime.getRuntime().exec(gweb);
catch(IOException ioe)
JOptionPane.showMessageDialog(this,
"Website is Unavailable",
"Error", JOptionPane.ERROR_MESSAGE);
//System.exit(0);
Is it possible to do the same on any Mac OS? I am not sure about the address of the relevant internet browser for a Mac.
Has anyone got any ideas?
Thanks ,
Gareth.

Wouldn't it be great if one of the Java System properties was the path to the default system browser?I don't think that would help. For a start, not all OSes have a concept of a default browser. Secondly, I think the way you'd open a URL in Safari would be open -a Safari http://www.etc rather than /Applications/Safari.app http://www.etc

Similar Messages

  • Opening a web browser from an After Effects script

    Hi,
    This may be a stupid question, but is there any way to open a web browser with a URL from an AE script, other than explicity lanuching the browser app via a sys.callSystem() command?
    I'm asking because obviously scripts need to run on both Windows and MacOS, and the user's default/preferred browser isn't necessarily going to be IE or Safari. That and I'd need to find the file path of the browser anyway somehow.
    It's to display external help.
    Thanks,
    Christian

    system.callSystem() can launch a URL without specifying the specific app. This code user's default browser. The last line is the main deal, the other stuff keeps it universal for PC and MAC.
    //CHECKS FOR USER OS
    function osCheck(){
              var op = $.os;
              var match = op.indexOf("Windows");
              if(match != (-1)){
                        var userOS = "PC";// User is on PC
              }else{
                        var userOS = "MAC";// User is on MAC
              return userOS;
    // RUNS OS CHECK FUNCTION
    var userOSVer = osCheck();
    //DEFINES PC OR MAC TERMINAL SYNTAX
    if(userOSVer == "MAC"){
              var urlLaunchCode = "Open";//Mac based
    }else{
              var urlLaunchCode = "Start";//PC based
    //ONCLICK FUNCTION FOR YOUR URL BUTTON CONTROL
    //urlLaunchCode = Open or Start / " " = keeps a space character separator / "http://myurl.com" = Defines the actual URL path
    myURLButton.onClick = function(){system.callSystem(urlLaunchCode + " " + "http://forums.adobe.com/thread/993523?tstart=0")};

  • Links in my email are not opening in web browser. They are bringing the browser up, but not taking me to sites.

    Links in my email are not opening in web browser. They are bringing the browser up, but not taking me to sites. What do I need to do?

    Me too but it's happening on my iMac after I did a software update this morning which included fixes in Mail it said. My Mail was fine before the update!

  • Cannot open application, web browser(default nokia...

    hello everybody..
    I want to ask about my phone nokia 5130c xpressmusic.
    I have some problem in my mobile.
    I cannot open application, web browser(default nokia), radio, and music player.
    How to solve that problem?
    thank you for your answer and attention.

    What does it say if you want to open the application? I think you should restore the factory settings!!!! If it doesn't work then update your software!!!!
    Alif

  • When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)

    When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)
    I have attached the url of the unwanted site.

    Use this add-on [https://addons.mozilla.org/en-US/firefox/addon/custom-new-tab/ '''Custom new tab'''].

  • How can i restore safari web browser on my mac book pro?

    how can i restore safari web browser on my mac book pro?

    Backup your system/data then start up holding down Command + R and select to reinstall your OS X. You have not mentioned which OS X you are using. If you have somehow deleted the Safari App for some reason, you need to reinstall the OS X to reinstall Safari properly. You should not lose any data, but if you do, then that is what the backup is for.
    Pete

  • How to open a web browser from java

    Hi
    Would anybody please help me with this. I need to open a web browser from my java app but I don't know. What method I can use?
    Thanks.
    Hung.

    You can use the Runtime class for this. It can run any command. So, you can run the .exe file of your Web browser.
    The following code will run Internet Explorer (assuming iexplorer.exe is in C:\Program Files\Internet Explorer):
    import java.lang.Runtime;
    public class Explore{
    public static void main(String[] args) {
    try{
    Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore");
    }catch (Exception e) {
    System.out.println("Exception: " + e);

  • Full internet signal however when I open a web browser it sometimes will not load.

    About 80% of the time my web browser (Safari or chrome) will not open the internet. I am connected wirelessly and have no other issues with the other mac and PC in the house. This a 15" 2011 Mac book Pro and have already had the Hardrive replaces after having it for 2 weeks. Any suggestions would be greatly appreciated.

    You need to specify a MIME type attribute.<br />
    Otherwise Firefox doesn't know which plugin to use.<br />
    Using <b>type="application/x-mplayer2"</b> will use the Windows Media player.
    <pre><nowiki>
    <EMBED src="foldername/wav name.wav" loop="TRUE" HIDDEN="TRUE" type="application/x-mplayer2">
    <embed src="lessons/CarrieUnderwood-LessonsLearned.wav" loop="true" hidden="true" type="application/x-mplayer2"> </nowiki></pre>

  • Web browsing on a Mac is a complete nightmare

    My experience of using OSX for web browsing is a complete nightmare, loads of web pages I visit load really slow even with 1mb broadband, and I always need two browsers open (safari & Camino) because when a web page doesn't load at all in safari, I switch to Camino to get the page to load.
    I would say this is a major design/technical fault with macs as most people I know use a computer for web browsing.
    What makes it worse it Apples' claims about Safari being a really fast browser when in practice it isn't fast at all and is incompatible with loads of sites.
    I've tried loads of browsers OSX including firefox but none of them match the speed and reliability of web browsing on a PC.
    I switched to Macs about a year ago and I'm seriously considering going back to PC's because of this which is a shame because the user experience of OSX is superior to Windows.

    I see a lot of people reporting slowness issues with Safari lately. The cause of this is unknown and pages load instantly on Mac. The page rendering on an Intel Mac is 2x as fast as on a PowerPC, altough this doesn't explain your issue. It should just work fine.
    However you can also try to follow some of the standard routines:
    • Make sure all internet configurations in your system are correct, such as IPv6 address and DNS settings.
    • Repair your permissions, in case of Safari not being able to write information to certain folders it might slow your browsing experience down.
    • Try to reset Safari, this deletes all cash files, history and cookie files. Also information for forms will be lost.
    By working trough these steps a lot of users have a good working Safari again. However, some people still don't have it working. This is probably due to some bugs, since 10.4 and some showed up in 10.4.6.
    eMac G4   Mac OS X (10.4.6)  

  • How to open a web browser from an windows phone app

    Hi everyone,
    I am pretty new to Windows Phone 7, and now what I am trying to do is to create a simple app. When a user click to start this app, a browser will open and show the content of a webpage from a specific address.
    I tried to use a webbrowser object, but it seems like that doesn't sport cookies. So I need my app to open a real web browser (maybe IE mobile) to do the job.
    Thank you.

    copying from stackoverflow: "If you want to embed a browser window inside your application then use  the WebBrowser control.  Add an instance of the WebBrowser control to  your form then you can reference it in code using the name you
    give  it.  (Default name is "webBrowser1")"
    Microsoft MVP J# 2004-2010, Borland Spirit of Delphi 2001

  • My adobe docs will no longer open in Reader...when I click on them they automatically open in web browser, however, I cannot view them on the browser either...help!

    All of my adobe docs now show up as white items instead of the regular red pdf doc they used to show up as.  When I double click on the pdf doc, it opens in the web browser, however, I cannot view the doc from the browser either.

    See http://windows.microsoft.com/en-us/windows/change-file-open-program#1TC=windows-7

  • Captivate (5) project won't open in Web Browser

    Hello,
    Since a few weeks I can't open my projects in the web browser. Accept one of the projects (only questionslides), i have been searching for differents in the setttings but i couldn't find any differtens. When I publish the project in a .swf still the project won't open.
    When I will get a preview in Web Browser or publish, the project is opening in the Web Browser and it looks like the project fade in and out in not even a second. A quick view of the background is visible . But i don't get any massage of error of something. And the page turn white.To preview the project in capitvate is no problem.
    I hope somebody could help me out.
    Roanne

    Hello,
    I do not know if you have Text Animations in your project? If yes, probably you are having issues due to the latest Flash Player. There is a hotfix to be found in this Captivate blog post:
    Solution for Captivate ...
    Lilybiri

  • Force a pdf to open in web browser

    Is there a way to make a media (pdf file) open in a web browser rather then download?

    To do that you'd have to change the mime type on the response which you
    can't do.
    M: 0415 193775
    E: [email protected]
    W: www.twoblokeswithapostie.com
    S: mariogugi
    On Fri, Sep 26, 2014 at 2:28 PM, Liam Dilley <[email protected]>

  • How can I stop Quicktime movies opening my web browser?

    Sorry if this has allready been brought up but I spent an hour searched the forums for an answer (And longer on google).
    My issue is that certain unsavory people seem to be exploiting an ability of quicktime to launch the default web browser and goto a page they designate. This unfortunately mean often I will download a movie (Named something it isn't typicly), run it and suddenly have 10 internet explorer windows pop up opening assorted **** sites, sites demanding spyware and malware installations and on at least one occasion site containing scripts to automaticly install a virus on loading.
    I'd like to how I can prevent this from happening short fo outright not using quicktime. Is there an option to disable a movies ability to link to web pages or a feature to block their attemtps to do so?
    Thanks.

    No. I don't have any viruses or spyware and I havn't been hijacked either. Look a little background on me, I work in tech support dealing with such issues for a living. Regardless I've had this happen on brand new computers I've set up and for the sake of been thorough in eliminating that idea as a possibility I followed every step and recommendation your links gave me and they turned up nothing.
    The problem is a function of certain .mov files which basically activate an imbeded hyperlink within the file, opening the default browser and loading whatever site the link lead to. If I could find a tame one that didn't send you to pornographic sites etc. I'd be happy to host it for you to test out yourself but frankly the only .mov files I've seen that do it are usually **** films themselves named something else (For instance one was named SydneyOlympics2004Opening) with the intention of luring unsuspecting victims into downloading them and running them in quicktime forcing them to load all these malicious pages. It's fine for me on my home network where the security settings are setup so hazardous sites can't actually do anything and the addition of pornographic images to my temporary internet folder has no concequences but at work that could get you fired and heavily fined in goverment employment.
    On a side note how another program could respond to a .mov file playing in quicktime opening web pages specific to that file and at set points in the movies timeline is beyond me. It would have to be a plugin for quicktime.

  • SLD page cant open in web browser

    Drear Friends
       I have installed ECC6 IDES server,  when I wish to open my SLD page it gives me page cannot be displayed message in web browser.  where my ECC Exchange infrastructure related page is displayed in web browser and other links such as Integreation builder "configuration( Repository)" ,  "Design (Integration Directory)", and Integration Monitoring "Runtime workbench" is displayed in web browser.
    Only System Landscape is not displaying. 
    XI link : http://ecc6:50400/rep/start/index.jsp ( all other links workfine here except SLD link )
    SLD link : http://ecc6:30000/sld/index.html
    I have checked SLD in sldchek transaction code that shows me errors describe below:
    14.05.2008                                                          Exchange Infrastructure: Test LCR Connection                                                                 1
    Properties of RFC destination SAPSLDAPI     
    RFC host:          %%RFCSERVER%%
    Program id:        SAPSLDAPI_UNICODE
    gateway host:     iwdf3054    <----
    I didnt supplied this, i supplied this "ecc6 "
    gateway service: sapgw00    <----
    I didnt supplied this, dont know about it where it comes and what it is.
    Testing the RFC connection to the SLD java client...
    RFC ping returned exception with message:
    Error when opening an RFC connection     
    Summary: Connection to SLD does not work     
    => Check SLD function and configurations     
    Now checking access to the XI Profile     
    Properties of RFC destination LCRSAPRFC
    RFC host:          %%RFCSERVER%%
    program id:        LCRSAPRFC_UNICODE
    gateway host:    iwdf3054 <----
    I didnt supplied this, i supplied this "ecc6 "
    gateway service: sapgw00<----
    I didnt supplied this, dont know about it where it comes and what it is.
    Testing the RFC connection to the SLD java client...
    RFC ping returned exception with message:
    Error when opening an RFC connection
    For your information
    During Installation I did "Register in Central existing SLD (Default) and then I passed
    SLD Host: ecc6
    SLD Port: 30000
    SLD Data supplier user: SLDDUSER
    Password : *****************
    Self Registration of ABAP Engin in Central SLD
    SLD Gateway host : ECC6
    SLD gateway instance number: 04
    SLD ABAP API User: SLDAPIUSER
    Password : ******************
    this is what i passed during installation phase.
    I have checked in SM59 with above mentioned RFC destination foud errors which I am mentioning below.
    Logon     Connection Error
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: hostname 'iwdf3054' unknown
    Error Details     LOCATION: SAP-Server ecc6_ECC_04 on host ecc6 (wp 2)
    Error Details     DETAIL: NiPGetHostByName: hostname 'iwdf3054' not found
    Error Details     CALL: gethostbyname
    Error Details     COMPONENT: NI (network interface)
    Error Details     COUNTER: 75
    Error Details     ERROR NUMBER: 11004
    Error Details     ERROR TEXT: WSANO_DATA: Valid name, no data record of requested type
    Error Details     MODULE: ninti.c
    Error Details     LINE: 320
    Error Details     RETURN CODE: -2
    Error Details     SUBRC: 0
    Error Details     RELEASE: 700
    Error Details     TIME: Wed May 14 17:09:05 2008
    Error Details     VERSION: 38
    please help me to solve my problem.. any help will be appreciated.
    Regards
    Naeem

    Dear Santosh
       Thank you for your prompt reply and help, 
       Please see my Host file information:
    For example:
         102.54.94.97     rhino.acme.com          # source server
          38.25.63.10     x.acme.com              # x client host
    127.0.0.1       localhost
    10.10.10.1      ecc6.myweb.com  <---- this is my FQDN as well..
    well I need to understand with wich information i am supposed to create new connections... i dont know anythng about Gateway service...
    i have only gateway host name which is ECC6.
    and if i skip it again i need the program_id for the connection which i dont have...  the connection need to be work automatically and type T if I am not wrong...  help by providing more information on values to create a connection as per my doubt.. i apprecaite your reply alot
    now please justify my problem...
    Regards
    Naeem

Maybe you are looking for

  • Bootcamp wont install windows 7 "get a blank white screen"

    hi i tried to bootcamp my computer everything was sweet till it goes to restart to start the windows install,when it goes to do it instead of taking the computer to the windows loading thing it is just a blank white screen pls help ive tried installi

  • Multiple units of measure

    Dear all MM experts, I have one semi finished goods which having two units of measure.I m giving one example as per the client business process. One artificial cubicle stone is being manufactured of weight 8.00 metric tonnes. In one production order

  • Why won't Apple fix this problem of iTunes Cutting off songs?

    I've owned seven different ipods and three iPhones. On EVERY ONE OF THEM iTunes cuts off many songs after two or three seconds of playing. We're talking here about songs either uploaded from commercially purchased DVDs or the iTunes store. I have no

  • Cleaning up my account

    I only bring this up here because the question occured when I tried to change some settings in Acrobat.com. I would like to change my email address from work to my personal email address but it says that address is allready in use. Is it possible to

  • Trying to Clone new SSD, keeps 'Ejecting' itself mid-copy

    I have bought a Crucial M4 SSD Sata 2. I am using a macbook 5.1 Mid 2008 Unibody, running mountain lion. I downloaded 'SuperDuper' and have renamed my SSD to 'My Mac'. I Then attempt to copy all files using SuperDuper, from my old HD to the New, usin