I'm currently using this simple command to open web sites from the command line:
open http://example.com
but when I open two, even doing
open http://example.com http://example.org
they open in separate Safari windows. How can I open them in the same window as two tabs without changing Safari's settings in any way?
Best Answer
Here's how to change Safari's general settings to open new URLs in new tabs: Make Safari open new links in existing windows as a tab, rather than a new window
I don't know if there's a way to do it by specifying an option at the command line.
EDIT: If you'd rather not change your Safari preferences for some reason but still want to be able to open new URLs in tabs from the command line, you could create an AppleScript like this:
and define an alias (or shell function, or shell script, or whatever) like this:
and then use it like this:
It's kind of ugly, but it should get the job done. I think. Unless you're really smitten with
open
.