Jump to content
Sign in to follow this  
AstronomerDaz

Old style DriveListBox and DirListBox - selecting items?

Recommended Posts

AstronomerDaz

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

 

Share this post


Link to post
Share on other sites
AstronomerDaz

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 by AstronomerDaz

Share this post


Link to post
Share on other sites
AdamUL

Try

ControlCommand("Select a Directory", "", "[ID:5]", "SelectString", 'd: [DATA]')

Adam

Share this post


Link to post
Share on other sites
AstronomerDaz

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 by AstronomerDaz

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×