Jump to content

Need help closing an IE warning box.


Recommended Posts

Im using _IENavigate to go to a wepage which redirects to an SSL page. When it redirects to the page a popup comes up asking whether to allow non secured content. This isn't important but the page wont redirect unless I answer it, so is there a way to just click yes, no or close the box?

Link to comment
Share on other sites

is that the only way to do it?? this script needs to be as quick and reliable as possible

edit: just tried that, it doesn't work because the ssl page is a redirected page, so it won't let me do anything until the page has loaded.

Is there a way i can run some sort of if / then statement where if it detects the box it sends the enter key?

Edited by freelancesam
Link to comment
Share on other sites

Try something like that:

If WinExists("Security Information") Then
    WinActivate("Security Information")
    WinWaitActive("Security Information")
    Send("{ENTER}")
EndIf
where can i put that?? I need it to be running that all the time while the iexplorer window is created
Link to comment
Share on other sites

There is an example of this in the Snippets database in the IE section... see my sig.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create a new Script that is started automatically from your Main script. Here is sample code.

Opt('WinTitleMatchMode', 4)

While 1 ;Starts perpetual Loop
  Sleep(1000) ;Slows Down Loop to Ease Load on CPU
  If WinExists("Security Information") Then
   WinActivate("Security Information")
   WinWaitActive("Security Information")
   ControlSend("Security Information", "", "{ENTER}")
   ExitLoop
  EndIf
  If not ProcessExists("MainScriptName") Then Exit ;Kills This script If the Main Script is Exited
Wend

Hope this helps.

EDIT:::

You could just make this a function and use it in your Main script as well.

Edited by Varian
Link to comment
Share on other sites

This is a good idea from Varian.

I just add some information:

Winwaitactive("Security Alert")

Controlclick("Security Alert", "" , "Button1")

Button1 means you can use the "AutoIT Windows Info" under the start -> program ->AutoIT V3 folder to get the name of the control.

Create a new Script that is started automatically from your Main script. Here is sample code.

Opt('WinTitleMatchMode', 4)

While 1;Starts perpetual Loop
  Sleep(1000);Slows Down Loop to Ease Load on CPU
  If WinExists("Security Information") Then
   WinActivate("Security Information")
   WinWaitActive("Security Information")
   ControlSend("Security Information", "", "{ENTER}")
   ExitLoop
  EndIf
  If not ProcessExists("MainScriptName") Then Exit;Kills This script If the Main Script is Exited
Wend

Hope this helps.

EDIT:::

You could just make this a function and use it in your Main script as well.

Link to comment
Share on other sites

Thanks for that correction. ControlSend requires a ControlID, which is probably not present in this case.

Also, if this Security Dialog pops up more than once, just remove the ExitLoop line so that the scipt

will run until the Main Program is no longer running.

This is a good idea from Varian.

I just add some information:

Winwaitactive("Security Alert")

Controlclick("Security Alert", "" , "Button1")

Button1 means you can use the "AutoIT Windows Info" under the start -> program ->AutoIT V3 folder to get the name of the control.

Link to comment
Share on other sites

Or you could look at the Snippets database as I suggested and it's all written for you already...

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...