background owners (and Re: unplaced grp)
Dave Cragg
dcragg at lacscentre.co.uk
Tue May 20 13:24:01 EDT 2003
At 2:54 pm -0600 20/5/03, Dar Scott wrote:
>On Tuesday, May 20, 2003, at 02:41 PM, Dave Cragg wrote:
>
>> You can get a list of the backgrounds in the stack with the
>>backgroundnames property. Then loop through each line, checking for
>>"the number of cards of background <whatever> = 0"
>
>Arg! I tried it and didn't get the syntax right. I left out "of
>cards" or something.
You may have just been surprised by the result as I was at first.
The backgroundNames property only returns groups whose
backgroundBehavior is set to true. But "the number of cards of
background x" will return the number irrespective of the
backgroundBehavior setting. However, as someone pointed out,
removing a background from a card automatically sets its
backgroundBehavior to true, so it should produce the right results in
this case.
But, it's possible to reset the backgroundBehavior of a removed
background by script, so my first solution was not foolproof. This
might be better:
put the number of backgrounds of this stack into tNum
repeat with i = 1 to tNum
if the number of cards of background i of this stack = 0 then
put the short name of background i of this stack & return after tList
end if
end repeat
## do something with tList
It should also be more reliable if, for example, you need to find
which backgrounds are placed on exactly 1 or more cards.
Cheers
Dave
More information about the use-livecode
mailing list