AstronomerDaz Posted August 9, 2013 Share Posted August 9, 2013 Hi all Pretty new to AutoIT, and struggling to figure out how to use an old vb6 type drive list box and folder list box, You know the one - you select a drive then the folder list box changes to list the folders, and you double-click to drill down to the folder you want... I have an application that I want to automate the production of some lunar thumbnail images. So far I can open the app, select the menu option, open the dialog box of the Lunar Calendar, click the current month button, click the next month button, click the Export button - and then I stop! At this point I need to select the drive/folder to save the images to. It will also be the same drive/folder (d:weblunarthumbs) on my laptop. I can't use Send to send the name of the folder I need to select, and I'm struggling to use ControlCommand to set the value I need in the drive or folder boxes.... I am thinking of setting the DriveListBox to my D drive, but can't seem to get this working. If anyone has a suggestion of how I can: Change the drive in the DriveListBox Select and drill into the folders in the DirListBox I would be *very* grateful!! Thanks Daz Link to comment Share on other sites More sharing options...
AstronomerDaz Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) I should add some code.... Here is my code for selecting the drive box and trying to select the right drive: ControlCommand("Select a Directory", "", "[ID:5]", "ShowDropDown") $obj = ControlCommand("Select a Directory", "", "[ID:5]", "FindString", 'd: [DATA]') MsgBox (0, "", $obj) First line works, 2nd line just returns a 0 - no matter what the find string text is. Edited August 9, 2013 by AstronomerDaz Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 9, 2013 Moderators Share Posted August 9, 2013 Check out FileOpenDialog or FileSelectFolder in the help file. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Solution AdamUL Posted August 9, 2013 Solution Share Posted August 9, 2013 Try ControlCommand("Select a Directory", "", "[ID:5]", "SelectString", 'd: [DATA]') Adam Link to comment Share on other sites More sharing options...
AstronomerDaz Posted August 11, 2013 Author Share Posted August 11, 2013 (edited) Thank you guys - I solved with a combination of the ControlCommand and ControlSend functions.I had to use ControlSend to get the text highlighted, and then ControlCommand to actually select it.Anyway, all working now ControlCommand($DirTitle, "", "[ID:5]", "ShowDropDown") ControlSend($DirTitle, "", "[ID:5]", "d" ) ControlSend($DirTitle, "", "[ID:4]", "bedsastro" ) ControlCommand($DirTitle, "", "[ID:4]", "SelectString", "bedsastro") ControlSend($DirTitle, "", "[ID:4]", "assets" ) ControlCommand($DirTitle, "", "[ID:4]", "SelectString", "assets") ControlSend($DirTitle, "", "[ID:4]", "images" ) ControlCommand($DirTitle, "", "[ID:4]", "SelectString", "images") ControlSend($DirTitle, "", "[ID:4]", "lunar" ) ControlCommand($DirTitle, "", "[ID:4]", "SelectString", "lunar") Edited August 11, 2013 by AstronomerDaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now