This code will take items from a text field and then convert every item to an entry in the list.
--list maker --
--Mark Daggett 1999
-- mark@flavoredthunder.com
-- http://www.flavoredthunder.com
--this behavior was created because often times with director you need to create lists that are
--either to large or change to much to hard code them into the behavior themselves.
--This property will take all the contents of a field and add them to a list. It will also use what ever item delimiter that you choose.
-- Right now the only output function is the getInfo handler which returns a random value from the list to the outPut field.
property pField --this is the field to pull info from
property pTemp -- this is a temp field
property pOutField -- this is the outPut Field
property pList
property pDelimiter -- this is the property for the delimiter
on beginSprite me
set the itemDelimiter = pDelimiter
set pTemp = ""
set pList = list()
set pTemp = the text of field pField
repeat with newItems = the number of items of pTemp down to 1
addAt pList, count(pList)+1 ,item newItems of pTemp
end repeat
end
on getInfo me
put getAt(pList, random(count(pList))) into field pOutField
end
on getPropertyDescriptionList me
set pdlist to [:]
addprop pdlist, #pField, [#comment:"Field where content is stored", #format:#field, #Default:""]
addprop pdlist, #pOutField, [#comment:"Field to out put contents", #format:#field, #Default:""]
addprop pdlist, #pDelimiter, [#comment:"What is your item delimiter", #format:#string, #Default:"|"]
return pdlist
end getPropertyDescriptionList
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA