Text file to list

I realize that this question has most likely been asked in the past, but a search on these forums and googling for the last 2 days has been futile.

I am trying to take a text file with odd formating, looking like this


and convert it to a table in a applescript application looking something like this


So far my attempts have failed due to my inexperience using Applescript. The problem I’m having is highlighted here in my code

on parseStories(thisFile, theDataSource)
set thisFile to thisFile as text
set thisFile to open for access file thisFile
set thisFile to "1
read thisFile before “<”
set currentTag to read thisFile until “>”

I cannot declare the file for input and pass it to this function.

Anyone have ideas?

You may want a routine similar to this one:

Or, perhaps, you want take a look to XML Tools, which is very useful to parse XML data (if you are doing so).
To read the file, simply:

set fContents to read alias "path:to:file"

Awesome stuff jj, I will download those xml tools and check them out.

The code you just made is very slick also and I believe I can implement that quickly.