Open Google Chrome with "Profile 1"

Hi,

I would like to open an open Google Chrome window with the profile “Profile 1”. I have 3 windows with 3 profiles open. After running the AppleScript, the wrong profile opens. The profile name is according to chrome://version/.

tell application "Google Chrome"
	do shell script "open -a 'Google Chrome' --args --profile-directory='Profile 1'"
	
	delay 3
	
	activate
end tell

I don’t have Chrome on my machine to test but I would guess it’s because you are ‘telling’ Chrome to do something… so it launches and does something. Even though it’s not the thing you want done.

Try removing everything but the do shell script line. Let it launch the browser. I would also add this as the first line of the script: use scripting additions. Apple recommends it for do shell script, although this is probably not the culprit in your case.

The other thing I would do is confirm that your shell command works as desired in the Terminal.

If you continue to get unwanted results, consider adding the -n option to the open command. This will create a new instance of Chrome, hopefully one that uses the desired profile.