Search code examples
pharo

From within Pharo, how do I open a Chrome web browser on a url?


From within Pharo 4.0, on a Mac, how do I open a Chrome web browser on the url "https://stackoverflow.com/search?q=%5Bpharo%5D+button+color" ?

I am relatively new to Pharo. I have looked at OSProcess, and tried to Google Pharo and AppleScript. I don't know where to look next... Thanks!


Solution

  • In OSX (as you seems to be, since you looked for AppleScript), with OSProcess, just doing something like:

    OSProcess command: 'open http://stackoverflow.com/questions/36268801/from-within-pharo-how-do-i-open-a-chrome-web-browser-on-a-url'.
    

    It will open the default browser.

    Now, if you want to open Chrome in particular (and not just "the browser"), you need to do something like this:

    OSProcess command: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome http://stackoverflow.com/questions/36268801/from-within-pharo-how-do-i-open-a-chrome-web-browser-on-a-url'.