Create macOS script to run a Terminal Command I want to ultimately create an executable file that will run a terminal command:
open -a &quot;Google Chrome&quot; --args --profile-directory=&quot;Guest Profile&quot;

I want to know what other text and where to add into the Script Editor with the above command so I can create an executable file that runs that command. I would like to do it with out the Terminal window opening. But if it has to open, I would like to add some more code so that is closes.
If there isn't, there should be a Chrome extension that does this.
Thanks.
You can use the do shell script command, however, I've changed the double-quotes to single-quotes in the open command, so as not to have to escape them with a backslash character.
Example AppleScript code:
do shell script &quot;open -a 'Google Chrome' --args --profile-directory='Guest Profile'&quot;

You can save this as an AppleScript application.
Note that if Google Chrome might already be running and you want to be switching to e.g. Guest Profile, then change the -a option of the open command to: -na


On my system it opens Google Chrome with the following dialog box: