It's been a while since I needed to write any scripts but a major disaster occurred and I find I now have to rewrite a number of scripts I previously had running. With the updated version and a lack of recent experience, I find I'm struggling with seemingly simple script so, please, bear with me.
I am testing to see if Outlook is open using Version 9 on XP SP2.
With Outlook open at the Inbox by default, the following code is doing something strange:
Code: Select all
GetActiveWindow>window_title,X,Y
Position>Outlook,window_title,1,pos
If>pos>0,Found,NotFound
Label>Found
SetFocus>Inbox*
Wait>3
GoTo>End
Label>NotFound
Msg>Didn't Find It
Label>End
Msg>Finished
On closing the Advanced Editor but remaining in the Macro screen and running the script again, the "Finished" messagebox opens within a split second of clicking the Run button. It doesn't set the focus on the Outlook window or wait 3 seconds. It instantly displays the "Finished" messagebox. Same thing happens if I run the script from the main MS window.
I have opened and closed the Advanced Editor numerous times to test this strange anomaly. I get these two different results simply from running the script with the Advanced Editor either open or not open. No other changes are made to other windows open at the time (other than the obvious differences with MS windows).
Please show me what I'm doing wrong.
TIA.