Hello all,
I want to check if chrome is opened, if yes, close it.
How do I do it?
Thanks
Close app
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1414
- Joined: Sun Nov 03, 2002 3:19 am
Re: Close app
Hi, yes we can do that. Use GetWindowList to generate a list of all open windows, then loop through them looking for "Google Chrome" in the title, and if it exists, close the window.
Code: Select all
GetWindowList>winlist
Separate>winlist,CRLF,windows
Let>k=1
Repeat>k
Let>this=windows_%k%
//Does the Window title contain "Google Chrome"?
Pos>Google Chrome,%this%,1,ChrPos,
//if yes, do something
If>ChrPos>0
CloseWindow>%this%
Endif
Let>k=k+1
Until>k>windows_count