I know there are several ways in MacOS to open Safari with a given URL from the command line like
open -a Safari http://stackoverflow.com
Or as an AppleScript
tell application "Safari" to open location "http://stackoverflow.com/"
But if I am starting the process e.g. programmatically I will only get the handle to the open/applescript process (which exits right after Safari is started).
How can I start Safari with a given URL and get the handle to the Safari process (it is still beyond me why it can't just pass the URL as a command line argument to the Safari executable)?