Jump to content
Sign in to follow this  
freelancesam

Need help closing an IE warning box.

Recommended Posts

freelancesam

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?

Share this post


Link to post
Share on other sites
Andreik

Try to set delay time and then Send("ENTER}")

For example:

Sleep(1000)
Send("{ENTER}")

When the words fail... music speaks

Share this post


Link to post
Share on other sites
freelancesam

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

Share this post


Link to post
Share on other sites
Andreik

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

Fortunately it`s no only way, maybe someone can help you more.

What is title of box?


When the words fail... music speaks

Share this post


Link to post
Share on other sites
freelancesam

im not sure what you mean by "title" but the header caption thing is "Security Information".

Share this post


Link to post
Share on other sites
Andreik

Try something like that:

If WinExists("Security Information") Then
    WinActivate("Security Information")
    WinWaitActive("Security Information")
    Send("{ENTER}")
EndIf

When the words fail... music speaks

Share this post


Link to post
Share on other sites
freelancesam

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

Share this post


Link to post
Share on other sites
Andreik

where can i put that?? I need it to be running that all the time while the iexplorer window is created

AdlibEnable()


When the words fail... music speaks

Share this post


Link to post
Share on other sites
freelancesam

is there another way?? this works, but while the script is running, the keyboard keeps pressing enter, regardless of whether it finds the window.

Share this post


Link to post
Share on other sites
DaleHohm

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

Share this post


Link to post
Share on other sites
Varian

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

Share this post


Link to post
Share on other sites
yyfy105

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.

Share this post


Link to post
Share on other sites
Varian

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.

Share this post


Link to post
Share on other sites
DaleHohm

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

Share this post


Link to post
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
Sign in to follow this  

×