Sign in to follow this  
Followers 0
cro77

Modal dialog freeze Autoit

4 posts in this topic

When clicking on a link, IE opens a modal dialog window (I assume modal because it is impossible to activate the original IE window before closing this one).

I've tried to use the send() command to fill in the parameters and close it, but it looks like AutoIt freezes.

In other posts I've seen that you can bring the focus on a given form and element like in:

#include <IE.au3>

$oIE = _IE_Example("form")

$oForm = _IEFormGetObjByName($oIE, "ExampleForm")

$oInputFile = _IEFormElementGetObjByName($oForm, "fileExample")

; Assign input focus to the field and then send the text string

_IEAction($oInputFile, "focus")

Send("C:\myfile.txt")

However in my case I don't know the name of the form and elements, because I did not write nor have a copy of the code.

How do I get around that? Thanks.

Share this post


Link to post
Share on other sites



When clicking on a link, IE opens a modal dialog window (I assume modal because it is impossible to activate the original IE window before closing this one).

I've tried to use the send() command to fill in the parameters and close it, but it looks like AutoIt freezes.

In other posts I've seen that you can bring the focus on a given form and element like in:

#include <IE.au3>

$oIE = _IE_Example("form")

$oForm = _IEFormGetObjByName($oIE, "ExampleForm")

$oInputFile = _IEFormElementGetObjByName($oForm, "fileExample")

; Assign input focus to the field and then send the text string

_IEAction($oInputFile, "focus")

Send("C:\myfile.txt")

However in my case I don't know the name of the form and elements, because I did not write nor have a copy of the code.

How do I get around that? Thanks.

You get them all by the various forms of _IEGet(something)Collection and loop through the list looking for your object. And you can get the HTML of the page and parse that for what you want with _IEBodyReadHTML().

:rolleyes:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks for the tip. I was able to find all the names. My problem now is that the code actually stops when the form gets open by clicking on the link. No code gets executed beyond that. Any idea?

Share this post


Link to post
Share on other sites

Thanks for the tip. I was able to find all the names. My problem now is that the code actually stops when the form gets open by clicking on the link. No code gets executed beyond that. Any idea?

It's normal for it to be blocked (paused) waiting for the page to load. Is it loading and completing normally? There is an option to continue without waiting for the page to load.

:rolleyes:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0