Is there an easy way of locating the file name field in a Save As dialogue window?
I'm trying to write something that automatically loads files from a specificed folder and then saves them to another specified folder. To do this I want to enter the full path and file name into the file name field but I can't find a way of doing that which works on all PC's and screen resolutions and when the window has been moved to a different area of the screen. I was trying to do it via Tabbing but the tab order in this program changes depending on what you last did in the program.
Locating the File Name Field in a Save As window?
Moderators: Dorian (MJT support), JRL
Re: Locating the File Name Field in a Save As window?
Ahh fixed it. Guess it would help if I looked at the shortcuts!
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Re: Locating the File Name Field in a Save As window?
A lot of the time, you can use the 'FindObject Wizard' (under Window Objects) and get the code to do it a little more reliably.
It is usually something like this example for NotePad
UISetValue>{"Open"},{"File name:"},{"MyFile.txt"}
It is usually something like this example for NotePad
UISetValue>{"Open"},{"File name:"},{"MyFile.txt"}
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Locating the File Name Field in a Save As window?
In my many years of experience I have never had to locate the filename box in a Save As window because it already has the focus. And the button is the default button so all I have ever had to do is:
Often it helps to slow down the keysend rate and maybe add a couple of small waits:
Don't over complicate things and get hung up with objects and handles and all that unless you REALLY need to. In 20 years I've NEVER had to do that for a regular Windows Save As box!!
Code: Select all
WaitWindowOpen>Save As
SetFocus>Save As
Send>the_filename
Press Enter
WaitWindowClosed>Save As
Code: Select all
Let>SK_DELAY=30
WaitWindowOpen>Save As
SetFocus>Save As
Wait>0.2
Send>the_filename
Wait>0.2
WaitWindowClosed>Save As
Press Enter
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Locating the File Name Field in a Save As window?
Every single time when the window opens the focus is in the area highlighted blue where it lists the Free Space. There is zero reason for the focus to be there especially as you can't even enter anything in that area. It makes no sense but that's how it is.
I'll have a look at the FindObjectWizard.
Many Thanks
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Locating the File Name Field in a Save As window?
Ok, I guess this is not a standard Windows Save As dialog then, or there's some customisation to it which is mucking up the focus. Never seen that pane before.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?