I'm taking this part by part now trying to work it out. Originally I had this:
Code: Select all
SetTitleMatchMode, 2
IfWinExist, QuickBooks Enterprise Solutions: Contractor 16.0, , ,
{
WinActivate
WinMaximize
MsgBox It found the Open Window!
}
IfWinExist, , An empty QuickBooks window already exists, ,
{
WinActivate
send {enter}
MsgBox I closed the Message for you
}
IfWinExist, QuickBooks Login, , ,
{
WinActivate
MouseClick, Left, 210, 228
MsgBox I exited the Login Screen
}
else
{
{
RunWait, QBW32EnterpriseContractor.exe, C:\Program Files (x86)\Intuit\QuickBooks Enterprise Solutions 16.0, max
WinWait, Intuit QuickBooks Enterprise Solutions: Contractor 16.0, , 10,
sleep 100
if ErrorLevel
{
IfWinExist, QuickBooks Login, , ,
; GoSub, %OpeningCompanyFile%
MsgBox It was the other version
MouseClick, Left, 210, 228
}
return
}
}
But I found that Else always executed sometimes skipping over all of the IfWinExist so I tried this:
Code: Select all
SetTitleMatchMode, 2
if
{
IfWinExist, QuickBooks Enterprise Solutions: Contractor 16.0, , ,
{
WinActivate
WinMaximize
MsgBox It found the Open Window!
}
IfWinExist, , An empty QuickBooks window already exists, ,
{
WinActivate
send {enter}
MsgBox I closed the Message for you
}
IfWinExist, QuickBooks Login, , ,
{
WinActivate
MouseClick, Left, 210, 228
MsgBox I exited the Login Screen
}
}
else
{
{
RunWait, QBW32EnterpriseContractor.exe, C:\Program Files (x86)\Intuit\QuickBooks Enterprise Solutions 16.0, max
WinWait, Intuit QuickBooks Enterprise Solutions: Contractor 16.0, , 10,
sleep 100
if ErrorLevel
{
IfWinExist, QuickBooks Login, , ,
; GoSub, %OpeningCompanyFile%
MsgBox It was the other version
MouseClick, Left, 210, 228
}
return
}
}
This doesn't work and I know it is because I have no expression after the If, but I have no clue what to put there to make this work or possibly I am headed in the wrong direction entirely. So my question is either:
How do I make this work as is?
OR
Where should I be looking instead (what documentation should I read)?