Jump to content

Recommended Posts

Posted (edited)

Hi all,

I'm using an embedded IE object to fill in a form and submit it. The form uses the POST method and has a Javascript function which runs when the form is submitted and changes some values according to what is entered into the form and generates a nonce, etc. When the form is submitted a file download is triggered.

How could I deal with this because at the minute the file download dialog is appearing? The only way I can think of is to send a keypress when the file download window becomes active but I have seen that this is not reliable.

Thanks in advance

Edited by meisandy
Posted (edited)

Here is the File Download dialog that appears (left) and window information for it (right)Download_Window.png

 

For future reference... if you activate a window (bring it into focus) then press Ctrl+PrtScn, it will screen capture the focused window only. so you can save time from having to redact information from the screen capture.

Edit:

This is true for Win7, for xp the keycombo is Ctrl+Alt+PrtScn... I dont know about Vista

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

For future reference... if you activate a window (bring it into focus) then press Ctrl+PrtScn, it will screen capture the focused window only. so you can save time from having to redact information from the screen capture.

 

Edit:

This is true for Win7, for xp the keycombo is Ctrl+Alt+PrtScn... I dont know about Vista

Good suggestion, only if you hadn't completely mangled the keys ;)

It is Alt+PrtScr for all of them. Probably goes back to Win95, if not longer.

Ctrl does nothing, or at least not that.

Posted

That's where I was going wrong - I knew there was a way but I thought it was Ctrl + PrtScr! Thanks :)

So does anybody know why the code I posted isn't working properly?

Posted

Good suggestion, only if you hadn't completely mangled the keys ;)

It is Alt+PrtScr for all of them. Probably goes back to Win95, if not longer.

Ctrl does nothing, or at least not that.

I meant that :sweating::whistle:

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Posted

Can you post your code so we can see what you are doing (makes it easier to help) or is this a private website?

I'm very sorry and I understand that it does make it harder for you to help me but the website is private. However if there is any code you would like to see in particular I could post 'snippets'...

 

Would ControlSend("File Download", "", "", "{ESC}") work?

 

Pressing the Esc key when the dialog appears does work really well, when I do it manually. However for some reason the code I posted earlier it is a bit hit and miss. Even when the File Download window is clearly active the code inside the If statement doesn't execute, and when I don't have the If statement all types of random things happen.

Posted

Forget winactive, use winexists, then winactivate, then Send("{SPACE}"), or enter or whatever key does what you want.

WinExists works a treat! Thank you! And I don't need to use WinActivate because ControlSend() still works perfectly.

And thank you NewPlaza for indirectly informing me about the Esc key being able to close the File Download box. :)

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
×
×
  • Create New...