Run Safari from terminal with given URL address without open command

Solution 1:

One solution would doing this in 2 times

  • Open safari
  • Using AppleScript to open the url tell application "Safari" to open location "http://www.google.com"

Here is a oneliner :

/Applications/Safari.app/Contents/MacOS/Safari & sleep 1 && osascript -e 'tell application "Safari" to open location "http://www.google.com"'

NB: you need to wait before running the AppleScript because Safari is not started yet. The sleep 1might not work in every case since it will really depend on how much time Safari will need to start.