[Qgis-developer] Problems in actions on MacOS

William Kyngesburye woklist at kyngchaos.com
Tue Nov 1 09:43:30 EDT 2011


On Nov 1, 2011, at 6:47 AM, Paolo Cavallini wrote:

> Hi all.
> The following action on MacOS:
> /Applications/Safari.app/Contents/MacOS/Safari http://www.google.it/search?q=%PROVINCIA
> 
> is returning in the browser
> 
> file:///Applications/http:/www.google.it/search%3Fq=SI
> 
> instead of the expected
> 
> http:/www.google.it/search?q=SI
> 
> Any explanation?
> Thanks.

The way to run/activate an application with a parameter on OS X is to use the open command.  You specify the application by name with the -a flag.  So:

open -a Safari http://www.google.it/search?q=%PROVINCIA

The simpler version, if you want to open an URL with the default browser, is to simply 'open' the URL.

It's possible Safari interprets parameters differently when run the *nix way by using the executable, most OS X applications are not made to take parameters this way.

But also, running an app the *nix way creates a new process - you get another icon in your Dock if one is running already, instead of opening a new window in an already-running app.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe




More information about the Qgis-developer mailing list