Page 1 of 1

Removing Geometry Manager Properties with a Script

Posted: Thu Dec 06, 2012 11:39 pm
by stephenmcnutt
My stack has become "infected" with Geometry Manager information. Using the "Remove All" button in the Geometry section of the Property Inspector apparently doesn't work, so I'm trying to do it with a script:

local tCount = 0
repeat for each line thisCard in the cardNames of stack "Heimdallr"
repeat with ctrlNumber = 1 to the number of controls on card thisCard
repeat with propLine = 1 to the number of lines in the custompropertysets of control ctrlNumber of card thisCard
if line propLine of the custompropertysets of control ctrlNumber of card thisCard is "cREVGeometry" then
put " " into line propLine of the custompropertysets of control ctrlNumber of card thisCard
add 1 to tCount
end if
end repeat
end repeat
end repeat
put tCount into message

That first "put..." line (about the middle line) is the problem. I get an error saying: Chunk: can't create a variable with that name (explicitVariables?)) near "custompropertysets", char 45

If I change that line from "put..." to "answer line propLine of the custompropertysets of control ctrlNumber of card thisCard", I get no error, but of course that doesn't get the job done.

If I change that line to "delete line propLine of the custompropertysets of control ctrlNumber of card thisCard", I get this error: (Commands: missing ',') near "of", char 28

Can you help me? I'm just trying to delete all the Geometry Manager properties from my stack.

Deleting a custom property set

Posted: Fri Dec 07, 2012 2:38 am
by Mark
Hi,

Try this:

Code: Select all

on mouseUp
     put the customPropertySets of this stack into myProps
     filter myProps without "cREVGeometryCacheIDs"
     filter myProps without "cREVGeometryCache"
     set the customPropertySets of this stack to myProps
     repeat with x = 1 to number of cards
          put the customPropertySets of cd x into myProps
          filter myProps without "cREVGeometryCacheIDs"
          filter myProps without "cREVGeometryCache"
          set the customPropertySets of cd x to myProps
          repeat with y = 1 to number of controls of cd x
               put the customPropertySets of control y of cd x into myProps
               filter myProps without "cREVGeometryCacheIDs"
               filter myProps without "cREVGeometryCache"
               filter myProps without "cREVGeometry"
               set the customPropertySets of control y of cd x to myProps
          end repeat
     end repeat
end mouseUp
Kind regards,

Mark

Re: Please Help Me Spot the Error

Posted: Fri Dec 07, 2012 3:51 pm
by stephenmcnutt
Thanks, Mark! That script seems to have done the trick. I've sampled the objects in my stack with Message Box scripts like:

put the custompropertysets of button "GoToCheckIn" of card "Welcome" of stack "Heimdallr"

...and I'm not seeing any geometry-related properties anymore. Super. Thanks again. You LiveCode Forum people are tops.