String error
Hey, I'm busy working on a small list script where you can either add to the list or view it, and the items entered are saved across runs. The script I have so far is...
property completedList : {}
display dialog "What would you like to do?" buttons {"View List", "Add"} default button 2
if result = {button returned:"Add"} then
A()
else
display dialogcompletedListbuttons {"Add"} default button 1
if result = {button returned:"Add"} then
A()
end if
end if
on A()
set x to text returned of (display dialog "What would you like to add?" default answer "" buttons {"Add"} default button 1)
set end of completedList to x
B()
end A
on B()
display dialog "What would you like to do?" buttons {"View List", "Add"} default button 2
if result = {button returned:"Add"} then
A()
else
display dialogcompletedListbuttons {"Add"} default button 1
if result = {button returned:"Add"} then
A()
end if
end if
end B
However I am getting this error:
error "Can’t make {\"Thing1\", \"thing2\"} into type string."
How do I fix this, and is there any better way to write the script I have?
Also, would it be possible to put theList into a choose from list, but make it so that when more than one item is entered (separated by a comma) that item goes to the next line on the list. Then could those items be sorted into alphabetical order, or is this asking too much of applescript?
Thanks