I am having trouble with my AHK loop command and was hoping someone out there could help me out. I have a situation where I have to connect to customer sites daily and authenticate myself with some key strokes (click submit, enter etc). If i connect to a customer for the first time that day, I have to authenticate w a reason. Any connections made to that customer that day to any other server i dont need to type in the reason. If i have entered the reason for the day, this loop works great:
#+r::
Loop
{
WinWait, Search - Google Chrome
IfWinNotActive, Search - Google Chrome, WinActivate1817, Search - Google Chrome
WinWaitActive, Search - Google Chrome
Sleep, 100
Send, {ENTER}
WinWait, Search Hosts - Google Chrome
IfWinNotActive, Search Hosts - Google Chrome, WinActivate, Search Hosts - Google Chrome
WinWaitActive, Search Hosts
Send, +{TAB}+{TAB}{ENTER}
}
return
Here is my issue, I also need this loop to run:
#+s::
Loop
{
WinWait, CRM Information
IfWinNotActive, CRM Information, WinActivate, CRM Information
WinWaitActive, CRM Information
Send, +{TAB}+{TAB}+{TAB}HPF{ENTER}
}
return
I know i can only run one loop at a time though. Essentially what i want to happen is to have some kind of If/else statement. I always need the first script running, but only need the second script to run if it is my first time connecting to the customer for the day. So i need to move number two into one. I always need the first one running, and if it sees CRM Information chrome screen title bar run the second part and if it doesnt see it, loop back to beginning.
I hope that makes sense!