Normal,LightPink2
Priority,MediumSeaGreen
Note,LightGreen
High,LightGray
Completed,LightSalmon
Hold,LightPink2
I have a handler that wishes to add new priorities to my list with a default colour of "black". First it has to check that the priority does not already have an entry. Using "Hold" as an example I have tried various constructs using "is among" and its various "chunk types" e.g.
Code: Select all
on mouseUp
set the itemdel to comma
If "Hold" is among the items of Field "ColourCodes" then
answer "Found in field"
else
answer "Not found in field"
end if
put Field "ColourCodes" into tMystring
If "Hold" is among the items of tMyString then
answer "Found in string"
else
answer "Not found in string"
end if
replace CR with " <NL> " in tMyString
If "Hold" is among the items of tMyString then
answer "Found in modified string"
else
answer "Not found in modified string"
end if
end mouseUp
I have attached a small stack file and would appreciate any comments as to the logic of "is among"
best wishes
Simon K