When is a window not a window? When it won't CLOSE!

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
shadowesq
Newbie
Posts: 4
Joined: Sat Feb 08, 2020 12:51 am

When is a window not a window? When it won't CLOSE!

Post by shadowesq » Tue Mar 17, 2020 2:52 am

Hey guys, I am tearing my hair out trying to solve what should be a simple problem.
I recently decided to use Internet Explorer instead of Google Chrome for one of my macros. However, things are not working out quite right.
When I run the macro, it starts up Internet Explorer and navigates to the correct page. Later in the the process, the macro clicks on one of the links in the page and brings up a second page. While focused on the second page, I copy all the data and process it as needed. Then I go to close the page, and this is where the trouble begins.
In Google Chrome, a simple ctrl-w will do the job of closing the window. But when I try to close the window in Internet Explorer, nothing happens. I even tried an alternative of using alt-f and closing the page via the drop-down menu - nothing happened. I know that the page is properly focused, because if I execute a ctrl-a, the page is correctly highlighted.
What, oh what am I doing wrong?

Here is the subroutine which I execute to attempt to close the second window.

SRT>CloseASHXTab
SetFocus>ujsportal.pacourts.us*
MouseMove>15,300
Wait>.5
LClick
Wait>.5
//
Press LCTRL
Wait>.5
Send>w
Wait>.5
Release CTRL
Wait>.5
WaitWindowClosed>ujsportal.pacourts.us*
END>CloseASHXTab

User avatar
Marcus Tettmar
Site Admin
Posts: 7156
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: When is a window not a window? When it won't CLOSE!

Post by Marcus Tettmar » Tue Mar 17, 2020 8:16 am

This works great for me:

Code: Select all

SetFocus>Internet Explorer*
Press CTRL
Send>w
Release CTRL
Every time I run that the active tab closes, until IE quits altogether. This also works:

Code: Select all

SetFocus>Internet Explorer*
Press ALT
Send>fc
Release ALT
As does:

Code: Select all

CloseWindow>MSN UK: Latest news*
(where MS UK: Latest News is the beginning of the window title for the particular tab I want to close.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

shadowesq
Newbie
Posts: 4
Joined: Sat Feb 08, 2020 12:51 am

Re: When is a window not a window? When it won't CLOSE!

Post by shadowesq » Fri Mar 20, 2020 2:57 pm

Thank you Marcus,
I will give those suggestions a try. Right now I am forced to close the window with a MouseMove and LClick, not the most elegant solution....

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts