Page 1 of 1

How to check if a target is a member of a group

Posted: Sun Dec 31, 2017 8:02 pm
by yeldarb
I'm sure I'm missing something simple, but I can't seem to figure out how to check if a clicked-on button is a member of a group. I've gotten this far:

Code: Select all

put the owner of the target
which correctly returns:

Code: Select all

group "responseGroup"
but if I change to

Code: Select all

put the owner of the target is grp "responseGroup"
I get an error:

Code: Select all

Chunk: source is not a container

Re: How to check if a target is a member of a group

Posted: Sun Dec 31, 2017 8:05 pm
by yeldarb
Ok, I need to say "the name of," as in

Code: Select all

 put the owner of the target is the name of group "responseGroup"

Re: How to check if a target is a member of a group

Posted: Sun Dec 31, 2017 9:28 pm
by bogs
Fun when stuff like that trips you up, ain't it just?

Re: How to check if a target is a member of a group

Posted: Sun Dec 31, 2017 10:04 pm
by quailcreek
If your code is in the group then I think what you want is something like this:

Code: Select all

put the short name of the owner of the target
If the code is in one of the members of the group then:

Code: Select all

put the short name of the owner of me

Re: How to check if a target is a member of a group

Posted: Sun Dec 31, 2017 11:11 pm
by [-hh]
You could use

Code: Select all

the childControlIDs of <group>
or

Code: Select all

the childControlNames of <group>