When using this line
set theItems to (do shell script "cat /some/file.txt")
display dialog theItems -- This returns {"item 1", "item 2", "item 3"}
set content of table view "table1" of scroll view "cspathAD" of window "paths" to theItems
But it doesn’t work. However, if I do this, it works:
set theItems to {"item 1", "item 2", "item 3"}
display dialog theItems -- This returns {"item 1", "item 2", "item 3"}
set content of table view "table1" of scroll view "cspathAD" of window "paths" to theItems
It seems that passing the result from “do shell script” back into the script treats the whole result as quoted or something.
For example, in the first example above, adding curly braces to theItems will actually put the whole string {“item 1”, “item 2”, “item 3”} into the first line of the table view, like it’s a quoted string:
set content of table view "table1" of scroll view "cspathAD" of window "paths" to {theItems}
I’ve tried setting the variable as text, as unicode text, as string, as item, paragraphs of, etc etc, and it just won’t work. Any ideas?
Thanks!