Two scripts that can help you prepare written documentation about behaviors:
1) lists each behavior name followed by
2) all user-settable properties with their default values
--DESCRIPTION:
--These scripts are to help create documentation from sets
-- of behaviors. They organize and output text that has
--information about the behavior
--
--AUTHOR: Daniel Cummings
-- behaviordoc@polysense.com
--
-----------------------------------
--Iterate through a cast full of behaviors
--to build a list of documentation on the
--properties, their types and default data
--
--USAGE:
--put getEntireCastBehaviorUserProps("trackerBehaviors")
--
on getEntireCastBehaviorUserProps theCastLibName
bigBuildString = ""
cnt = the number of members of castLib theCastLibName
repeat with i = 1 to cnt
if (member i of castLib theCastLibName).type = #empty then next repeat
bigBuildString = bigBuildString & RETURN & getBehaviorUserPropsAsString(member i of castLib theCastLibName)
end repeat
return bigBuildString
end
-----------------------------------
--DESCRIPTION:
--Returns a string the holds the comments,
--default values and types for the
--user properties of the behavior script
--you specify in the argument.
--Calls getPropertyDescriptionList() to get
--the data stored with the behavior.
--Does not act on behavior instances
--but on the script itself.
--
--USAGE:
--put getBehaviorUserPropsAsString(member("mybehaviormember"))
--
--Run this function over the behavior Library to
--get the framework of documentation built.
--
on getBehaviorUserPropsAsString theMember
if theMember.type <> #script then return ""
hands = theMember.script.handlers()
if not (hands.getOne(#getPropertyDescriptionList)) then
buildString = "----------" & RETURN & string(theMember.name) & RETURN & "----------" & RETURN
buildString = buildString & "No user interface for this behavior." & RETURN
return buildString
end if