Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing Browser Window Help
#1
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?
#2
I used this macro to test, and it worked well.
Macro
Code:
Copy      Help
rep 100
,run "iexplore"
,int w1=wait(0 win("Internet Explorer"))
,clo w1

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

I will test out your second suggestion tonight.

Thank you for your assistance.
#4
you could try

Code:
Copy      Help
ShutDownProcess("Internet Explorer")
#5
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.
#6
is there a way to close only the window or tab in a browser with the certain url. e.g
Function Function7
Code:
Copy      Help
clo web("http://www.quickmacros.com")
i know this doesnt work but is there anything like this i can use
#7
Depends on web browser.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)