Save As window query

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
R2DU
Newbie
Posts: 5
Joined: Mon Jan 19, 2009 2:30 pm
Location: Guildford, UK

Save As window query

Post by R2DU » Wed Jun 03, 2009 4:47 pm

Hi Guys,

Can someone please explain to a newbie like me how I can get the window handle of a Save As window when it starts to download a file, for example from an FTP site?
I'm using Internet Explorer to connect to the FTP site first, and am downloading three zipped files to deal with later.
But even though I've used WaitWindowOpen>Save As*, and that works, as soon as it begins downloading the file (and the file size counts up), it loses focus and the script continues!

Here's the attempted code I have so far (for 1 file), with an attempt to wait for the Save As window to close (which didn't work) :(

Let>Delay=2
Let>WIN_USEHANDLE=0
WaitWindowOpen>Save As*
SetFocus>Save As*
Wait>Delay
Press>Enter
WaitWindowClosed>Save As*

I bet this is really easy, but I haven't found anything on this in the forums so far!

Thanks

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

GetWindowHandle

Post by gdyvig » Wed Jun 03, 2009 5:30 pm

Try this:

GetWindowHandle>Save As*,SaveAs_hwnd


Gale

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Jun 03, 2009 6:36 pm

May not be possible but if it's an FTP server can you get the files directly using MacroScheduler's FTP functions?

R2DU
Newbie
Posts: 5
Joined: Mon Jan 19, 2009 2:30 pm
Location: Guildford, UK

Post by R2DU » Thu Jun 04, 2009 2:34 pm

Fixed it!

Thanks Gale - you pointed me in the right direction, and after much perseverence I realised that the window which opens up during file download actually starts with the name of the file being downloaded!
D'oh! :oops:
I was put off by seeing the counter showing how much data was being downloaded at the start of the window's title on screen.
And as each of the 3 files I'm downloading will always start with the same name before ending in a session number, I can use wildcards to pick it up, then SetFocus on it, and finally (what I really needed) use a WaitWindowClosed to make sure that the script doesn't move on before the file has been completely downloaded.

Me_Again - thanks for your suggestion, I hadn't tried MS's FTP stuff as yet, and as I'd spent a not-inconsiderable amount of time on the rest of the script (and that was working!), I wanted to fix what I had - and to understand for next time! :wink:

Thanks both - this really is a great forum and a superb program too! :D

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