Split a text file into a list - HELP!!!

This is really doing my head in…

I am reading in a file which is comma sep’d variables in what I thought was a list.
eg {“steve”,“bob”, “dave”,etc}

Instead it is creating a list with a single item
eg {"steve,bob,dave,…etc}


I guess this is probably really basic stuff but I’m struggling to get my skills up.

Cheers folks!

What is your code?

Meanwhile, you can create a list from a text using TIDs (text item delimiters). You can use them directly from a “read” command as follow:

read alias "path:to:file.txt" using delimiter ","

Here, you’ll get a list of texts-between-commas.
If you text doesn’t come from a “read” command, you can accomplish the same as follow:

set theText to "joe,moe,toe"
set AppleScript's text item delimiters to ","
set listFromText to text items of theText
set AppleScript's text item delimiters to {""}
listFromText --> {"joe", "moe", "toe"}

More info about TIDs here: http://macscripter.net/unscripted/unscripted.php?id=P32_0_1_0_C


You are a super star! Works perfectly.

Thanks very much