Page 1 of 1

List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 9:26 am
by erikhans08
Did someone once write a handler to list all Custom Properties in a stack and its stack files, buttons, fields, etc.

Re: List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 2:41 pm
by dunbarx
Hi.

There is a native property, "the customProperties", that does this.

Craig Newman

Re: List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 2:55 pm
by FourthWorld
@erikhans08: which property are you looking for?

Re: List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 5:10 pm
by dunbarx
@Richard, he wants custom properties.

@ Erik. Are you able to write your own handler that lists all the custom properties for any or all controls in a stack file? If you can, then, as Richard implied, you could extract any particular one of interest. But without that list, there is no way of knowing what those properties are, since you made and named them at some time in the past.

Craig

Re: List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 6:02 pm
by FourthWorld
Thank you, Craig, but I think his thread title made that clear; pardon the brevity of my question.

I asked because I used to spend a lot of time making all sorts of stack reporting tools which produced text listing of all sorts of stuff. But over time I realized I never actually used that output because it was disconnected from the objects they were reporting - to take any action meant I still had to find the object in question and edit it.

To find the best solution here will depend on what's truly needed, so it would be helpful to find out what will be done with the custom property once found.

Re: List all Custom Properties in a stack

Posted: Mon Apr 06, 2015 8:13 pm
by TerryL
You could use the customKeys property, which returns a line list of all custom props for an object. Another simpler solution is to look in each object's properties inspector under custom properties if there are only a few objects in the stack. Terry

Code: Select all

local AllCustomProps
put the short name of this stack &cr& the customKeys of this stack &cr after AllCustomProps
repeat with i = 1 to number(cds in this stack)
  put the short name of cd i &cr& the customKeys of cd i after AllCustomProps
  repeat with j = 1 to number(btns in this cd)  --btns, flds, imgs, graphics...
    put the short name of btn j &cr& the customKeys of btn j &cr after AllCustomProps
  end repeat
  --...
end repeat

Re: List all Custom Properties in a stack

Posted: Tue Apr 07, 2015 9:26 am
by erikhans08
'The customkeys of my mainstack returned all of my custom properties, exactly as in the Stack Property Inspector.
My custom properties are all in my mainstack and I set them within a handler called from Message Box when I first open the mainstack.
The names of the custom properties are all preceded by a "u", as in uHeight, following The Gaskin Guidelines.
These 2 also show up although not declared by me:
Selection Description = false
revstack = false

So I can get all of my custom properties from Stack Property Inspector or Message Box.
I just like to be able to see them all at once.