Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select COMBOBOX item by it's name
#1
Hi,

I have an application where I need to automate selecting an item from a combobox, but the items in the combobox are not necessarily always in the same order (or the same number of items) so I can't just select by mouse xy or index position.

[Combo box]
Dog
Horse
Cow
Chicken
Pig

Is there a way to activate an item in a combo box by its name--for example always pick Cow from the list, regardless of its index position?

Thanks!

Tony
#2
Use accessible object functions. Look in floating toolbar -> Windows, controls.
#3
I'm not having a lot of luck with that.

Interestingly when I "find accessible object" on that COMBOBOX it says the value is "zz" which is odd because when I look at the control it says "COL Logo". And the test button fails to find the control unless I deselect "value".

But then when I go to CbSelect, it returns "item not found".

Code:
Copy      Help
int w=win("" "indesign")
Acc a.Find(w "COMBOBOX" "" "class=InDesign_COMBOBOX[]id=8482" 0x1004)
a.CbSelect("''COL Logo''" 1)

I'll try automating InDesign via COM in QM to see if I could just do it that way. It do it from VBA all the time.


Forum Jump:


Users browsing this thread: 1 Guest(s)