Create macOS script to run a Terminal Command
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 "open -a 'Google Chrome' --args --profile-directory='Guest Profile'"
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: