I have 20 google chrome profiles, and I need to select a specific profile from the 20 profiles already running, namely select, and not restart-open a new tab. I implemented this through the MouseClick transition, but it’s too long, and I can’t get the right ProcessID for a certain profile, help
Profile := "Default" ;set the specific profile
for process in ComObjGet("winmgmts:").ExecQuery("Select * FROM Win32_Process WHERE Name = 'chrome.exe'") {
Commandline := process.Commandline
str := process.ProcessId
StringReplace Parameters, Commandline, % Process.ExecutablePath
StringReplace Parameters, Parameters, ""
IfInString, Parameters, Profile
{
WinActivate ahk_pid %str%
Break
}
}
return
}