I use multiple instances of the Chrome browser for different profiles, each with their own google account. I'm trying to automate a task using Applescript and Automator, and have set up Automator to feed a set of URLs to chrome, then run the following script:
# input is the list of url's from the previous task
on run {input, parameters}
# The below is an applescript loop
repeat with theURL in input
tell application "Google Chrome" to open location theURL
end repeat
# We must return something so we just return the input
return input
end run
Is there away to specify that I want to open Chrome with the browser version I specify in the "Person" or profile of Chrome, i.e. as user XXXX@gmail.com and not as user ZZZZ@gmail.com?
return input
is just part of the template code provided by the Run AppleScript action for convenience. It can and should be deleted if it's not specifically needed by the next action in the workflow, or this is the last action in the workflow.open -n -a 'Google Chrome'
it just terminates and opens another window for the previous occurrence.pgrep -n Google\ Chrome
in Terminal I will be back multiple PIDs, is that the case? Or, are you just getting a new window that's accessing a different profile?open -na "Google Chrome" --args --profile-directory=Default
and for a different profile changeDefault
to e.g.Profile 1
, and so on, and this is the name of the profile folder in$HOME/Library/Application Support/Google/Chrome
not your name.