0

Is there a way to build an ObjectSpecifier using name instead of array number in Javascript Applescript?

search = ObjectSpecifier().buttons["Add"].value
items = items.groups.whose({_match:[search,"Selected"]})

The index for "add button" is different in each item, so if I build the ObjectSpecifier with buttons[3] Instead of buttons["Add"], it only returns the items that have add button at the index 3. I also tried "ObjectSpecifier().buttons.byName("Add").value", but it doesn't work.
Thanks!!!

chibop
  • 119
  • 9

1 Answers1

0

buttons["Add"].value should work. Make sure all the items in the arrays you're filtering have buttons["Add"] in them. If not, filter out the ones who don't have buttons["Add"] first, and then filter again with buttons["Add"].value.

jl303
  • 1,461
  • 15
  • 27