I have a text file with three lines
Line one
Line two
Line three
And run the following bit of applescript on the file :
set dbs to {read file thePath using delimiter "
"}
--set dbs to {"Line one", "Line two", "Line three"}
choose from list dbs with prompt "choose a database"
Gives me an error :
error "Can’t make {\"Line one\", \"Line two\", \"Line three\"} into type string."
number -1700 from {"Line one", "Line two", "Line three"} to string
So I take the comment tag (–) out of the second line to make dbs into exactly the same list it’s complaining it can’t convert, and the choose works. But I don’t want to rewrite my code every time the contents of the file changes… Why can’t it convert from one list when it can convert from the other?
set dbs to every paragraph of (read file thePath)