I am new to AHK and am trying to remap some of my keys to open and close certain applications on my pc to make my life easier. One of them is Google Chrome, I managed to open the profile I want of chrome but I am having trouble closing that specific profile. Below is what I have.
PgDn::
Process, Exist, chrome.exe
If ErrorLevel <> 0
Process, Close, chrome.exe
Else
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 1"
return
This opens up the chrome to a profile I want but when I press the button again it closes any and every chrome window open. I understand that's because I close the chrome.exe process, I cannot figure out how to close that specific profile.
Ultimately what I want to do is when the Page Down key is pressed
If Chrome Profile 1 is not opened, open it.
If Chrome Profile 1 is minimized, maximize it.
and if Chrome Profile 1 is opened and maximized, close it.
If someone could help I'd really appreciate it.