I am trying to parse a set of lines read from a file in Applescript.
This is how my code looks:
my status_dialog(indexData)
set AppleScript's text item delimiters to return
set indexFreq to (text items 1 thru 1 of indexData)
indexData contains a set of lines.
The line delimiter is not working. indexFreq returns me the whole set of lines again instead of the first one.
I am a newbie in here and the online resources arent helping me in this.
Many thanks!
Pradeep
Your code should work as expected. The problem may be that
returnis not the correct character for this particular set of lines. Line breaks can be carriage return, line feed or both, depending on the program or system that created the file.You can try using different characters instead of
return:Also, to make sure the rest of your code is set up proprly, do a simple test:
This should produce the following (in your AppleScript console):