Jump to content

Confusion with controlClick


 Share

Recommended Posts

Hi Everyone, I'm trying to download a generated file from a LAN using IE. below is a screenshot

Posted Image

previously i wanted to use something like

winwaitactive("File Download"), I also tried winwaitactive("SciCare") and then send("s") or send("!s"), but none of those worked.

It seemed like it couldn't recognize the pop up window being active at all.

Then I found out about ControlClick but I'm a bit puzzled by the help file

Posted Image

winwaitactive("File Download")

controlclick("File Download","&Save",4424)

I used the above code and it didn't work.

I also tried controlclick to click the "File" menu item in Outlook and wasn't able to do that, apparently that menu does not have an ID.

Link to comment
Share on other sites

Hi Everyone, I'm trying to download a generated file from a LAN using IE. below is a screenshot

previously i wanted to use something like

winwaitactive("File Download"), I also tried winwaitactive("SciCare") and then send("s") or send("!s"), but none of those worked.

It seemed like it couldn't recognize the pop up window being active at all.

Then I found out about ControlClick but I'm a bit puzzled by the help file

winwaitactive("File Download")

controlclick("File Download","&Save",4424)

I used the above code and it didn't work.

I also tried controlclick to click the "File" menu item in Outlook and wasn't able to do that, apparently that menu does not have an ID.

Worry about correctly addressing the window first before you worry about addressing the control. See if this even works:
$hFileDownload = WinGetHandle("File Download", "&Save")
MsgBox(64, "Handle", $hFileDownload)

What I suspect is that MsgBox() won't appear at all because your script is being blocked by the _IE* action you took to produce the popup in the first place. So the code to handle the popup never gets run at all until the popup is answered and gone, and the _IE* action finishes.

;)

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
Link to comment
Share on other sites

Worry about correctly addressing the window first before you worry about addressing the control. See if this even works:

$hFileDownload = WinGetHandle("File Download", "&Save")
MsgBox(64, "Handle", $hFileDownload)

What I suspect is that MsgBox() won't appear at all because your script is being blocked by the _IE* action you took to produce the popup in the first place. So the code to handle the popup never gets run at all until the popup is answered and gone, and the _IE* action finishes.

;)

Thank you PsaltyDS, you are right, it is not recognizing the window and I still have no idea how to do so.

right now I am using _IENavigate($oIE, "url") to initiate the download, which would then have the file download popup, I used your msgbox code and nothing popped up

I think I have omitted something which might be an issue. When I click the "Export to CSV" link, it generates this csv file for me to dl. but when I use IEclicklinkby text, i get IE telling me that it's blocked the download. thats why I'm ysing IENavigate instead. Maybe if that could be changed it would be much easier? Do you happen to know how to bypass this?

Posted Image

When I use IElinkclickbytext, and I got the above pop up msg from your code

Link to comment
Share on other sites

Thank you PsaltyDS, you are right, it is not recognizing the window and I still have no idea how to do so.

right now I am using _IENavigate($oIE, "url") to initiate the download, which would then have the file download popup, I used your msgbox code and nothing popped up

You can add the $f_wait parameter in _IENavigate() so the script will continue:
_IENavigate($oIE, "url", False)
WinWait("File Download", "&Save")

I think I have omitted something which might be an issue. When I click the "Export to CSV" link, it generates this csv file for me to dl. but when I use IEclicklinkby text, i get IE telling me that it's blocked the download. thats why I'm ysing IENavigate instead. Maybe if that could be changed it would be much easier? Do you happen to know how to bypass this?

When I use IElinkclickbytext, and I got the above pop up msg from your code

That makes sense, the popup isn't there, so the handle to display is null.

;)

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
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...