Page 1 of 1

Enumerating the contents of a group

Posted: Sat Nov 07, 2009 10:19 pm
by andrew@ugh.net.au
Hi,

I have a group containing a number of check boxes. I would like to get a list of all those selected without having to hard code a list of the field names in my script. I was hoping for something along the lines of:

get the members of group "foo"

returning an array of each object in the group. I could then go through, check which ones were buttons and check their highlight etc

Is this possible? Any tips with the syntax?

Thanks,

Andrew

Posted: Sat Nov 07, 2009 10:49 pm
by SparkOut
If you use Mark's handlers found here: http://runrev.info/Objects%20list.htm you can easily

Code: Select all

get the objects of group "theGroupName"
HTH
SparkOut

Posted: Sat Nov 07, 2009 10:49 pm
by mwieder
How about something like

Code: Select all

repeat with x=1 to the number of controls of group tGroup
  if word 1 of the name of control x of group tGroup is "button" and the style of control x of group tGroup is "checkbox" then
    put the id of control x of group tGroup into myArray[x]
  end if
end repeat
That would give you your array and you can take it from there.

Re: Enumerating the contents of a group

Posted: Thu May 08, 2014 12:02 am
by andrew@ugh.net.au
Thanks, that worked.