How to open an URL with Google Chrome from command-line with a specific profile?
I've so far come up with the following but the
--args --profile-directory="Profile 22" part does not seem to pass the argument to Google Chrome:
open -a 'Google Chrome' https://www.bing.com --args --profile-directory="Profile 22"
-g option is intended to not bring the Google Chrome window immediately to the foreground. C.f. the documentation for
-g Do not bring the application to the foreground.
The following does work, but I'm trying to avoid using specific full path for Google Chrome:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --profile-directory="Profile 22" 'https://www.bing.com'