I think it goes beyond doing a setfocus. For example, in Outlook if a meeting reminder pops up, you can't do anything with the main menu on Outlook until the meeting reminder is "dealt" with.

AutoIt uses something called the "Adlib" section. Basically, its a one line routine that checks a condition (i.e. IfWinExist) then executes something (i.e. Sendkeys) based of of that condition. The "Adlib" section condition is checked after each line of code is run then automatically returns to where it left off.

To duplicate something like an "Adlib" section, you would have to run a second script (not Shell or Call) and have the script loop until the Window to be dealt with exists (i.e. wait until Meeting Reminder pops up, then SEND an {esc}).

[ 14 May 2002, 18:24: Message edited by: Chris S. ]