How can I open Chrome from the command line with specific pages in tabs in Mac OS X?

34

4

From the command line in Mac OS X, how can I open Google Chrome with a specific list of URLs open in tabs, with certain ones pinned?

Nathan Long

Posted 2014-02-14T15:41:47.737

Reputation: 20 371

Answers

37

There is simpler way to open applications in Mac OS

open -a "Google Chrome" http://stackoverflow.com http://wikipedia.org

Mikhail Chuprynski

Posted 2014-02-14T15:41:47.737

Reputation: 481

13

An alias to open Chrome:

alias chrome="/Applications/Google\\ \\Chrome.app/Contents/MacOS/Google\\ \\Chrome"

An alias to open Chrome with 2 given pages in tabs:

alias chromex="chrome --pinned-tab-count=2 http://www.google.com http://www.microsoft.com"

Open the 2 pinned pages

chromex

RedBug

Posted 2014-02-14T15:41:47.737

Reputation: 523

1

The --pinned-tab-count flag has since been removed: https://bugs.chromium.org/p/chromium/issues/detail?id=37596.

– thinkterry – 2018-08-17T16:51:32.180

4

Alternatively, I have scripts that do it like this:

open -a /Applications/Google\ Chrome.app http://google.com http://stackoverflow.com

Jeff

Posted 2014-02-14T15:41:47.737

Reputation: 141