Jump to content

Old style DriveListBox and DirListBox - selecting items?


Go to solution Solved by AdamUL,

Recommended Posts

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

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...