9
5
I'm having trouble with opening Safari from terminal. Command I tried is
/Applications/Safari/Contents/MacOS/Safari http://www.example.com
Safari opens and tries to navigate to the url:
file:///Current/Terminal/Path/Here/http:/www.example.com
I know, I could do it using open
:
open -a safari http://www.example.com
But I can't. The bigger picture is quite complicated: I'm actually trying to run the browser from command-line .NET application (which is running using mono). I use System.Process
.NET class to run the command and I have to be able to control the process (get process Id, check if it's active, kill it if necessary, etc.). Using open
command does not return correct process Id (I tried using open
with -W
switch - does not help either).
It get's a little more tricky because I'm trying to fire it from
Process
.NET class, but I was able to work problems around using your solution, and that's why I'm setting it as accepted. Thanks! – MarcinJuraszek – 2013-12-17T21:05:32.140