Clicking on save in a download window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
nats
Newbie
Posts: 4
Joined: Fri Jul 14, 2006 6:00 pm
Location: Ontario

Clicking on save in a download window

Post by nats » Fri Jul 14, 2006 6:15 pm

When using MacroScript WebRecorder, and the standard "File Download" pop-up opens, (The one with "Open" "Save" " Cancel" "More Info") how do I click on "save"? This step, and none of the steps related to the pop-up are recorded.

Everything else I need to do is in WebRecorder, and I would prefer not to use a recorded macro, (macro scheduler), but if that is the only way, how do I call a macro from within WebRecorder?

Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jul 14, 2006 6:25 pm

At this point you will need to send keystrokes. Alt-S clicks the save button. So you need to add this code:

WaitWindowOpen>File Download - Security Warning
Press ALT
Send>s
Release ALT

etc.

If necessary modify the window title accordingly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

nats
Newbie
Posts: 4
Joined: Fri Jul 14, 2006 6:00 pm
Location: Ontario

Post by nats » Fri Jul 14, 2006 8:06 pm

The keystrokes do not seem to get to the window.
The window is focused on the screen, but until I click, the script will not continue.

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"Download Report Data"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

WaitWindowOpen>File Download
SetFocus>File Download

Press ALT
Send>s
Release ALT
Press ALT
Send>s
Release ALT
Press Enter

Label>end_script
LibFree>hIE
Label>end_script

nats
Newbie
Posts: 4
Joined: Fri Jul 14, 2006 6:00 pm
Location: Ontario

Post by nats » Fri Jul 14, 2006 8:22 pm

Adding 40 sec delays after each keystroke works????
Any idea why, do I need to do this after each keystroke?


Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"Download Report Data"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

WaitWindowOpen>File Download

SetFocus>File Download

Wait>40
Press ALT
Send>s
Release ALT
Wait>40
Press ALT
Send>s
Release ALT
Wait>40
Press Enter

Label>end_script
LibFree>hIE
Label>end_script

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jul 14, 2006 8:27 pm

Sometimes a short delay of upto a second is helpful, but you should certainly not need it to wait 40 seconds! Perhaps you are not waiting for the right window before sending the keystrokes? Have you got the window title correct? You have two ALT-s sequences? Is the second one meant for a new window? If so you need to wait for that to be active. Perhaps that's why the delay helps. Use a WaitWindowOpen there too maybe.

If you want to send screen shots or send a copy of your script to support we'll have a better idea of what it is you are doing and what windows you need to deal with and will be able to help you create a reliable script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

nats
Newbie
Posts: 4
Joined: Fri Jul 14, 2006 6:00 pm
Location: Ontario

Post by nats » Fri Jul 14, 2006 8:43 pm

There is only one window, the first alt-s is to choose save, and the second alt-s is to accept the default file name for the save, then enter to close the screen.

I would have thought that
WaitWindowOpen>File Download
would be all that is needed, why wait 40 seconds after the window opens.
I have lowered the wait between keystrokes to 20 seconds and the script is successful about half the time.


Thanks for your great support, and the offer to send this issue to tech support. I will try the script on another PC first and let you know.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jul 14, 2006 8:58 pm

you might also try:

WaitWindowOpen>File Download*
WaitReady>0
Wait>1

press ALT
Send>s
Release ALT

waitready>0
wait>1

press ALT
send>s
Release ALT

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts