Selecting an object
pete at mollysrevenge.com
Mon Mar 14 13:15:58 EDT 2011
Thanks. I guess the way I was doing it was mimicking how I would do it manually in the IDE but your way sounds neater so I'll give it a whirl.
On Mar 13, 2011, at 9:50 PM, J. Landman Gay wrote:
> On 3/13/11 11:43 PM, J. Landman Gay wrote:
>> On 3/13/11 7:45 PM, Peter Haworth wrote:
>>> I know that was suggested and I can't remember why it didn't work for
>>> me - I think it may have been because the group may not exist. Or
>>> maybe it's because I'm copying the control into the group, not
>>> creating it?
>> For copying, use this:
>> copy button "myButton" to grp "mygroup" of cd "thatCard"
> Oops, this will fail if you aren't on that card. I should have said:
> copy button "myButton" of cd "thatCard" to grp "mygroup" of cd "thatCard"
> But there's a shorter way using the "currentCard" syntax. That's sort of like defaultstack, only for cards. So you could set that first, do the work, then set it back:
> put the number of this cd into tOrigCard
> set the currentcard of this stack to "thatCard"
> copy btn "myButton" to grp "mygroup"
> ... anything else you need to do there
> set the currentcard of this stack to tOrigCard
> So all the work gets done without the user ever changing cards.
>> If you no longer want the original, you'd need to delete it after that:
>> delete button "myButton" of cd "thatCard"
>> If the group doesn't exist then you'd need to create one first. You can
>> do that remotely too:
>> create grp "new group"
>> place grp "new group" onto cd "thatCard"
>> remove grp "new group" from this cd
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode