Selecting an item from a ComboBox

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
cgaston
Junior Coder
Posts: 24
Joined: Sat Jan 22, 2005 11:52 am
Location: Ottawa, Canada

Selecting an item from a ComboBox

Post by cgaston » Sat Jan 22, 2005 12:40 pm

I am trying to automate the export of a Crystal report into a PDF file.

After I tell Crystal that I want to do an export, it is displaying a window where I have to choose the export format from a ComboBox: TXT, PDF, RPT, etc...

First question: I can TAB to the field, but what is the key sequence to open the drop-down list?

Second question: The items shown in the drop-down list is varying from one PC to another. I know that PDF will always be one of the choice, but I do not know where it will be placed in the list. How could I select it?
Unfortunately, I do not have the option to enter my choice from the keyboard into that field. I must select from the drop-down.

As much as possible, I am trying to avoid mouse control. So, I am looking fo a solution that could be implemented through key sequences.

Thank you,

Gaston,
Ottawa, canada

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Jan 22, 2005 5:06 pm

First question: I can TAB to the field, but what is the key sequence to open the drop-down list?
Most combo boxes use the DOWN arrow to make selections.
How could I select it?
Unfortunately, I do not have the option to enter my choice from the keyboard into that field. I must select from the drop-down.
If the desired choice is not always in same position, then you could make a loop to press Down, compare the value to desired value. If OK, continue, it not OK press Down by one more count., compare again, continue or loop until desired value is located.

Or you may be able to tab to the combo box, and paste in the desired value and it may be accepted when you tab out. This will depend on how the combo box has been designed in different applications.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sun Jan 23, 2005 8:28 pm

ALT+ will typically open that drop down menu. You can then release alt, and use further keys (like P, or the arrow keys)

MSched recently introduced a fantastic new command:

SelectMenu>WindowTitle,MenuIndex[,SubMenuIndex[,SubMenuIndex[,...]]]

Example:
SelectMenu>Notepad*,0,2

If the locations of the items differ from PC to PC, try something like:
Press ALT
Sen>f
wait>0.3
Sen>p
Release ALT

This *should* select the menu which has "F" underlined (ie, it's entered as "&F"). If nothing is underlined with an F, it may select the first instance that starts with an F.
Same for the sub-menu that has P underlined, or starts with a P.

If you're on about combo boxes, rather than "context sensitve menus" (file, edit, view, etc), pressing P while focused in that field should jump to the next instance beginning with P. Pressing it twice jumps to the second, etc.

Guest

Post by Guest » Mon Jan 24, 2005 12:53 am

Thank you Bob,

As you mentionned, it ended up to be much simpler than I thought: Tabbing to the ComboBox and "Send"ing the text that match the desired entry.

Gaston.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts