Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing Browser Window Help
Last week I sent an email asking for help on closing out the web browser.
I was using the lef command to click on the red X to close the window.
The problem was the window did not consistently close out, so the macro would not work when it ran again.

It was suggested to use the clo command.
This command works to close the browser, however this to does not seem to do it consistently.

I have even tried different combinations of clo's, lef's and waits.
This may work several times correctly, but at some point it just does not work one time which throws everything off.

Does anyone have any suggestions?
I used this macro to test, and it worked well.
Copy      Help
rep 100
,run "iexplore"
,int w1=wait(0 win("Internet Explorer"))
,clo w1

Try this
Copy      Help
int w1=win("Internet Explorer")
,clo w1; err break
,if(!IsWindow(w1)) break
Tested the first solution today, had the same problem.

I will test out your second suggestion tonight.

Thank you for your assistance.
you could try

Copy      Help
ShutDownProcess("Internet Explorer")
Running the clo command in that loop seems to have done the trick.
Previously I could only get about 1-8 hours before an error, now I have gone over the 24 hour mark without any problems.

Thank you everyone for your assistance, it is appreciated.
is there a way to close only the window or tab in a browser with the certain url. e.g
Function Function7
Copy      Help
clo web("")
i know this doesnt work but is there anything like this i can use
Depends on web browser.

This code closes tab containing "" in Internet Explorer 8.
Copy      Help
int w1=win("Internet Explorer" "IEFrame")
act w1
Acc a=acc("" "PAGETAB" w1 "DirectUIHWND" "**" 0x1404)
Acc ac=acc("Close Tab (Ctrl+W)" "PUSHBUTTON" w1 "DirectUIHWND" "" 0x1001)

Forum Jump:

Users browsing this thread: 1 Guest(s)