Group/Ungroup by script

Monte Goulding monte at sweattechnologies.com
Thu Feb 17 22:30:55 EST 2011


On 18/02/2011, at 2:10 PM, J. Landman Gay wrote:

> On 2/17/11 7:59 PM, Peter Haworth wrote:
>> I have a need to add a specific control to an existing group.  The following works but I'm curious if there's a better/easier way?
>> 
>> select group "Test"
>> put "group " into mycommand
>> repeat for each line myId in the selectedObjects
>>  	 put myID&&  "AND " after mycommand
>> end repeat
>> put the long ID of button "Button" after myCommand
>> do myCommand
> 
> Try:
>  copy control 1 to grp x
> 
> Substitute a control reference for "control 1".
> 
> If you don't need the original control after it's been copied to the group, delete it.

Other options are using relayerGroupedControls to move a control into a group or if this is a control that you are creating then you can create a control in a group.

Cheers

Monte



More information about the Use-livecode mailing list