I don't think it is offtopic. He's asking how to close a window that /might/ pop up in that particular place of his code.
Since it's at a particular point in your script, I'd put a WinWait command using the "seconds" parameter, so it will check for it, but give up if it doesn't find the window. The problem there is that the waiting takes some time.
You could also use 920094519's solution.
Code:
;somewhere at the beginning of your script
SetTimer, CloseUnwantedWindow, 250 ; checks every 250ms
Return
;your normal script, unmodified
WinWait, ReportXtender Viewer - [$$RX Database$$(READ ONLY) - 06/25/2002 RO],
IfWinNotActive, ReportXtender Viewer - [$$RX Database$$(READ ONLY) - 06/25/2002 RO], , WinActivate, ReportXtender Viewer - [$$RX Database$$(READ ONLY) - 06/25/2002 RO],
WinWaitActive, ReportXtender Viewer - [$$RX Database$$(READ ONLY) - 06/25/2002 RO],
MouseClick, left, 64, 39
Sleep, 100
MouseClick, left, 96, 78
Sleep, 100
MouseClick, left, 112, 567
Sleep, 100
Send, 0002470242
MouseClick, left, 462, 631
Sleep, 100
MouseClick, left, 124, 40
Sleep, 100
MouseClick, left, 220, 186
Sleep, 100
MouseClick, left, 360, 184
Sleep, 100
WinWait, Export Document Pages,
IfWinNotActive, Export Document Pages, , WinActivate, Export Document Pages,
WinWaitActive, Export Document Pages,
Send, u{SHIFTDOWN};{SHIFTUP}\bshipman\0002470242{ENTER}
;somewhere at the very end of your script
CloseUnwantedWindow:
WinClose, , No documents found!
Return
WinClose might kill the whole program, though so instead you might want
Code:
CloseUnwantedWindow:
If WinExist("","No documents found!")
{
WinActivate, , No documents found!
Send, {enter}
}
Return