How do I convert a list to a string so that the items are seperated by spaces?
set mystring to items 1 thru -1 of mylist as string
TIA
How do I convert a list to a string so that the items are seperated by spaces?
set mystring to items 1 thru -1 of mylist as string
TIA
gw:
Set your text item delimiters to space:
set mylist to {"one", "two", "three"}
set {tdl, text item delimiters} to {text item delimiters, space}
set mystring to items 1 thru -1 of mylist as string
set text item delimiters to tdl
mystring
Simpler yet, you don’t have to itemize - a list will coerce even if not all of the elements are text:
set mylist to {"one", 2, true}
set {tdl, text item delimiters} to {text item delimiters, space}
set mystring to mylist as string
set text item delimiters to tdl
mystring --> "one 2 true"
Nice catch, Adam, thanks!
Thanks. I’ll give it a try.