I wrote a script for Illustrator CS a while back. This script creates a template. The script works well. Over time I have tinkered with it adding features and such. One problem I had was if I had Ill 8 open when the script was run it would target Ill 8 instead of CS. So I added an on run end run in the script so I could make sure CS was the targeted app.
The original script had a property associated with it. This property is a list of customers. If a customer is not in the list, I add the name, sort the list and then save the new list in the property so next time I run the script (saved as an app) I could choose the customer if they were in the list. Now that I have had to change the script, because of the above explanation, the property is not being saved as it was before. So the question is how can I save the property as a list that can be changed as I add names. Here is the basic script for the list part of the script.
--property custList : {"AAA_Not Here", "Cust1", "Cust2"}
on run
run script thisScript
end run
script thisScript
property custList : {"AAA_Not Here", "Cust1", "Cust2"} -- I tried placing the property here but the result is the same. Always just what the property defines here.
set temp to {}
set sorted to {}
choose from list custList
set cust to the result as text
if cust = "AAA_Not Here" then
display dialog "Who is the customer?" default answer ""
set cust to text returned of the result
if cust is not in custList then
set custList to custList & cust
end if
end if
set theCount to count custList
repeat with k from 1 to theCount
repeat with anItem in custList
set theChk to anItem
repeat with i from 1 to (count custList)
if theChk is not less than item i of custList then
set theChk to item i of custList
end if
end repeat
end repeat
set sorted to sorted & theChk
repeat with i from 1 to (count custList)
if item i of custList is not theChk then
set temp to temp & item i of custList
end if
end repeat
set custList to temp
set temp to {}
end repeat
set custList to sorted
return custList
end script
If you take out the on run and the script end script parts the list is remembered as desired.
Thanks.
PreTech