I am trying to write a macro for some automation, and part of the requirement is to be able to automatically select an option from the programs drop down menu, but im having problems determining the content in the dropdown box.
So that you have an idea of what im trying to do, i'll give a little more information. The program im trying to automate is Alcohol 120%, the "Copy Wizard" to be precise. The copy wizard has a dropdown menu of available drives, and I want to be able to select a drive from the dropdown box (depending of what parameters where passed to the macro).
So, essentially I call the macro like "MyMacro /drive=K:", and that will bring up the copy wizard and select K: from the dropdown box (in theory at least!)
At first I thought I may be able to use the GetListItem() function, but I think I may of misunderstood, as I think that is only for lists.
When viewing system windows, the item im interested in is reported as :
591454 - TComboBox ""
As a last resort, im thinking of doing it manually by moving the mouse over the item, clicking it, and moving the mouse down the list, and picking up the text with the text capturing functions available, but this isnt a very elegant solution, and would like to be able to read the contents internally if I could.
Does anyone have any suggestions for me?
Thanks.
Determining Content of Dropdown box
Moderators: JRL, Dorian (MJT support)
Hey Jimmy you reminded me of a article I saw a while back I think this might help you out.
http://www.mjtnet.com/blog/2009/07/02/s ... down-list/
http://www.mjtnet.com/blog/2009/07/02/s ... down-list/
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Many list boxes/drop downs can be "drilled down" on by simply typing the text of the item you want to select. With the drop down focused try typing the first few characters of an item you want to select. If that works then you can just use Send>text. You may have tried it already, but if so you didn't say, so I thought I should mention it. Don't overlook the obvious.
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?
Thanks for the reply guys.
mtettmar : That is an option that I considered but dismissed, but after you mentioning it, I might give it some extra thought.
The one thing I want to account for, is the fact that the /drive=x: parameter may not be valid (possible typing mistake etc.. when calling the macro), and I may want to bring up a message saying this ("specified drive not found" or similar). So I suppose what I could do is, place the mouse over the dropdown, set the keyboard focus to the dropdown, Send>text as appropriate (eg. "(F", or "(F:"), and then do a text capture of the dropdown to see if the content corresponds with what im expecting (the drive letter in the dropdown, corresponds what was passed to the macro).
I think that may be a more elegant solution than my suggested scanning all the items with the mouse approach, so thanks for making me rethink my approach!
I havent checked out sarver31's link yet, so i'll have a look at that now.
mtettmar : That is an option that I considered but dismissed, but after you mentioning it, I might give it some extra thought.
The one thing I want to account for, is the fact that the /drive=x: parameter may not be valid (possible typing mistake etc.. when calling the macro), and I may want to bring up a message saying this ("specified drive not found" or similar). So I suppose what I could do is, place the mouse over the dropdown, set the keyboard focus to the dropdown, Send>text as appropriate (eg. "(F", or "(F:"), and then do a text capture of the dropdown to see if the content corresponds with what im expecting (the drive letter in the dropdown, corresponds what was passed to the macro).
I think that may be a more elegant solution than my suggested scanning all the items with the mouse approach, so thanks for making me rethink my approach!

I havent checked out sarver31's link yet, so i'll have a look at that now.