<< Click to Display Table of Contents >> Navigation: 3. Script Language > Window Operations > Window Operations |
MiniRobotLanguage (MRL)
CAW. Command
Close all Windows
Intention
This command will close all windows that meet the given specification.
There are two modes, in which you can operate this command.
In Mode 1, you give just two parameters, the window-text, and the window-class.
Then all such windows will be asked to close.
In Mode 2, you use 3 parameters.The third parameters is the runtime in seconds.
In this mode, CAW. will be like a "Close New Windows" and close only Windows that appear NEW while it is running. You can also run it as a background robot using PRR. and PRE. See example 2.
Unlike most other window-commands, CAW. will only take Window-Text and Window-Class as parameters. CAW. has a "deadlock-protection" against windows which can not be closed.
Once it runs against such a window that can not be closed, it will stop execution. Such windows are for example windows which have dialogs open or hang. In such cases you should use CPR. or KPN. to get rid of the hanging program.
Syntax
CAW.[P1][|P2][|P3]
Parameter Explanation
P1 - Windows-Class
P2 - Window-Text
P3 - Timeout in seconds if window can not be closed
Example
'***********************************
' CAW.-Demo
' In this Mode, all such windows will be closed.
'***********************************
'DBM.2
CAW.ieframe|private
: §§NUM=20
GSB.openem
PAU.10
CAW.ieframe
END.
MBX.!
END.
:openem
FOR.§§LOP|1|§§NUM
EXS.iexplore|www.fa2.de
PAU.1
NEX.
RET.
ENR.
'***********************************
' CAW.-Demo 2
' In this Mode only NEW appearing windows will be closed.
'***********************************
'DBM.2
CAW.ieframe|private
: §§NUM=2
GSB.openem
MBX. This IE will stay open after the CAW.$crlf$ because its third parameter.
PAU.3
' Run CAW. as Parallel-Robot for 20 Seconds
PRR.
PRT.Parallelrobot starting.
CAW.ieframe|private|20
PRT.Parallelrobot ending.
END.
PRE.
: §§NUM=30
GSB.openem
MBX."Parallerobot CAW will close all NEW IE's until you click me."
END.
:openem
FOR.§§LOP|1|§§NUM
EXS.iexplore|www.fa2.de
PAU.0.5
NEX.
RET.
Remarks
CAW. is generally better then KPN. or CPR. because it will close the applications through the surface.
Limitations:
-
See also: