Internet Explorer Save Open Cancel Popup

Get help with using AutoHotkey and its commands and hotkeys
johnegracejr
Posts: 3
Joined: 09 May 2016, 10:58

Internet Explorer Save Open Cancel Popup

28 Dec 2016, 16:16

I am trying to control the yellow (or gold) and white "Save Open Cancel" popup of Internet Explorer (I "believe" it's also ActiveX but I'm not sure about that last part). I have a (clunky) script that works the first time but not more than once. I would prefer a way to select the popup that doesn't need tabs and down arrows but can't seem to isolate it.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Thanks in advance
From: Jay Grace
User avatar
Nextron
Posts: 1037
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Internet Explorer Save Open Cancel Popup

29 Dec 2016, 10:55

I've got a script where I faced the same issue. I couldn't use WinHttp.WinHttpRequest.5.1 because I needed the stored IE credentials, and because of a company proxy I couldn't get MSXML2.XMLHTTP working, so I was stuck with a InternetExplorer.Application GUI. From what I understood from other forums, is that MS deliberately made the download prompt hard to detect or interact with other than simply sending keystrokes as a security measure. So I think your best bet is looping a PixelSearch on the orange color before sending the proper keys.

For the reason your script only works once; is there a command the script hangs on (look in AHK's last lines)?
The more I know:
The more I know,
I know nothing.
Guest

Re: Internet Explorer Save Open Cancel Popup

03 Jan 2017, 12:00

johnegracejr wrote:I am trying to control the yellow (or gold) and white "Save Open Cancel" popup of Internet Explorer (I "believe" it's also ActiveX but I'm not sure about that last part). I have a (clunky) script that works the first time but not more than once. I would prefer a way to select the popup that doesn't need tabs and down arrows but can't seem to isolate it.

Kudos to whoever wrote the ImageSearch function. (fast and efficient - niiiice).

Interestingly I had the same intermittent results when using it. There must be some interesting magic happening in either Internet Explore, ActiveX, and the "open save cancel" popup. Back to the drawing board. I've also had a chance to do a lot of testing (over the holidays) and the script always works if I only check one of the checkboxes but almost never works correctly afterwards. I've also added a few line that close the "open save cancel" popup in the hopes that reopening it would be like a reset - no joy. Also attempted several variation on selecting different elements of the webpage on the theory that starting from the same location would allow the same keystrokes to arrive in the same location - also no joy.

If I could activate the child window or directly controlsend on the control I think either of those would work. I'm currently researching SendMessage to see if I can make that work.

Thanks in advance for any other suggestions.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Thanks in advance
From: Jay Grace
User avatar
jeeswg
Posts: 2637
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Internet Explorer Save Open Cancel Popup

03 Jan 2017, 20:39

It seems to be called the 'notification bar'.
If I go to
AutoHotkey Downloads
https://autohotkey.com/download/
and left-click on Download AutoHotkey Installer.
I get the boxes Run, Save, Cancel.
Pressing alt, shows that r, s, c are hotkey triggers.
Alt+r and alt+s seem to work, but not alt+c to cancel (it brings up a toolbar on the right).
>> Pressing alt+n activates the bar, Esc then closes the bar.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
jeeswg
Posts: 2637
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Internet Explorer Save Open Cancel Popup

23 Jan 2017, 02:55

I've fixed my script and managed to get Acc to close the notification bar directly,
without sending any key presses.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
bodosko
Posts: 13
Joined: 05 May 2017, 10:49

Re: Internet Explorer Save Open Cancel Popup

19 May 2017, 12:15

What if I want to click the "Save as" button, that is hidden inside the arrow button ?
I'm trying to get its object path with no success. :/
User avatar
jeeswg
Posts: 2637
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Internet Explorer Save Open Cancel Popup

19 May 2017, 13:49

What you have to do is invoke the down arrow (e.g. via Acc), and then invoke the menu item (e.g. via Acc or via sending keypresses to it).

Note: doing alt+n, tab, down, showed that 'a' was an accelerator key to invoke the 'Save as' button. This could be different for other languages.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



==================================================

Another approach would to be invoke a menu item, which I tried to do but couldn't work out which PostMessage parameters to use (e.g. which hWnd).

See:
best utilities + best AutoHotkey scripts (+ useful tips) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28149

which lists this (didn't work in this instance):
[HotkeyP][HotkeyP.zip contains spy.exe]
[spy.exe watches for WM_COMMAND messages, e.g. when you click menu items]

and which also lists this:
[a ToolTip appears showing menu item IDs for context menus]
Get Info from Context Menu - Scripts and Functions - AutoHotkey Community
https://autohotkey.com/board/topic/19754-get-info-from-context-menu/

I used the ToolTip script which showed me that the command ID for 'Save as' was: 53409.

Failed WM_COMMAND attempts:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

bodosko
Posts: 13
Joined: 05 May 2017, 10:49

Re: Internet Explorer Save Open Cancel Popup

19 May 2017, 14:21

Thanks!
Using the following code worked here. :)

Code: [Select all] [Download] GeSHi © Codebox Plus

PostMessage, 0x102, % Ord("a"), 1,, % ahk_class #32768
Does it also work if the window is not focused or is minimized?

I'm able to get the ContextMenu hWnd with

Code: [Select all] [Download] GeSHi © Codebox Plus

WinGet, hWnd2, ID, ahk_class #32768

But I don't know what to do with it later.

I tried to use the aToolTip script and it didn't work. It displays command ID -1 for all the context menu items.
So I tried sending the ID you got using PostMessage on every possible way, but it didn't work too.
User avatar
jeeswg
Posts: 2637
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Internet Explorer Save Open Cancel Popup

19 May 2017, 14:48

I'm not really sure about hidden windows etc, because normally a menu appears as a visible window, you would have to test.

The question could be instead, how to set the default Save folder for Internet Explorer, to ask as a new question on the AHK forum, (and/or to ask about which window to send the WM_COMMAND message to in Internet Explorer).

I will check the ToolTip script, probably it's an old script, and you're using AHK x64.

[EDIT:] I fixed the ToolTip script:
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971
bodosko
Posts: 13
Joined: 05 May 2017, 10:49

Re: Internet Explorer Save Open Cancel Popup

22 May 2017, 07:48

I think I'm gonna stick with your PostMessage solution, it fits what I need.
I don't want to set a default save location, because I need to change the filename and folder for each file depending on other variables.
User avatar
jeeswg
Posts: 2637
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Internet Explorer Save Open Cancel Popup

22 May 2017, 09:42

One thing you could do is download to a temporary folder, and then move/rename files as needed.

But then I don't currently know how to reliably set the download folder. Cheers.

Return to “Ask For Help”

Who is online

Users browsing this forum: HotKeyIt, kczx3 and 49 guests