Page 1 of 1

Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 03:57
by Xproplayer
Hey guys, just trying to acomplish the title. All the docs I find so far just mention opening urls or with certain profiles but not both. Just want to open 2 urls with a specific chrome profile that will not already be open (cant do winactivate and then open url)

Re: Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 04:39
by BoBo

Re: Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 04:49
by Xproplayer
Already know some of the url parameters like so https://superuser.com/questions/876243/ ... ctivate-it just need to know how to add urls to it.

Re: Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 04:58
by jmeneses

Code: Select all

#NoEnv
#SingleInstance force

ChromeUrls =
(Join`s
"https://autohotkey.com/boards/viewforum.php?f=4"
"https://autohotkey.com/boards/viewforum.php?f=5"
"https://autohotkey.com/boards/viewtopic.php?f=5&t=37347&sid=ab796fd13e8d43caad178ceebcb0bc41"
)
PathChrome := "X:\PortableApps\GoogleChromePortable\GoogleChromePortable.exe"
Run %PathChrome% %ChromeUrls%,,Max
ExitApp


Re: Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 05:03
by Xproplayer
jmeneses wrote:

Code: Select all

#NoEnv
#SingleInstance force

ChromeUrls =
(Join`s
"https://autohotkey.com/boards/viewforum.php?f=4"
"https://autohotkey.com/boards/viewforum.php?f=5"
"https://autohotkey.com/boards/viewtopic.php?f=5&t=37347&sid=ab796fd13e8d43caad178ceebcb0bc41"
)
PathChrome := "X:\PortableApps\GoogleChromePortable\GoogleChromePortable.exe"
Run %PathChrome% %ChromeUrls%,,Max
ExitApp

I need the chrome to open with a specific profile, but this looks amazing. Whats the noenv and singleinstance force do, as I'd like to merge this with my master AHK script that does lots of other statements.

Re: Open 2 urls with specific chrome profile

Posted: 22 Sep 2017, 05:38
by BoBo

Code: Select all

#SingleInstance, Force

Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-tab --profile-directory="chromeProfileName1" "https:\\www.autohotkey.com"
SoundBeep
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-tab --profile-directory="chromeProfileName2" "https:\\www.theguardian.co.uk"
SoundBeep
ExitApp
Tested with two already existing/logged in instances/profiles as well as it is creating those from scratch.
As you already know, once you run it that way you can work with its separate process PIDs to trigger those instances quite reliable.
Hope that helps.

Re: Open 2 urls with specific chrome profile

Posted: 23 Sep 2017, 23:32
by Xproplayer
BoBo wrote:

Code: Select all

#SingleInstance, Force

Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-tab --profile-directory="chromeProfileName1" "https:\\www.autohotkey.com"
SoundBeep
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-tab --profile-directory="chromeProfileName2" "https:\\www.theguardian.co.uk"
SoundBeep
ExitApp
Tested with two already existing/logged in instances/profiles as well as it is creating those from scratch.
As you already know, once you run it that way you can work with its separate process PIDs to trigger those instances quite reliable.
Hope that helps.
This worked almost perfect,

First I had to use "Profile 1" instead of "chromeProfileName1" but you may have used that as an intentional palceholder.
Also I was having issues with the hotkey firing multiple times and the tabs not opening in the same window. Two open more than 1 url I simply removed the --new-tab on the the first line, and add a 100-250ms delay.