1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
property theCSVFilename : "/Users/username/Desktop/example.csv" property theCSVDelimiter : ";" on readAndParseCSVData() -- open csv file set csvRows to read file theFile using delimiter {return} -- Parsing the information set parsedArray to {} copy the text item delimiters to OldDelims set the text item delimiters to theCSVDelimiter repeat with csvLine in csvRows --tell application "Automator" --set end of parsedArray to call method "componentsSeparatedByString:" of csvLine with parameter theCSVDelimiter --end tell set end of parsedArray to (text items of csvLine) end repeat set the text item delimiters to OldDelims return parsedArray end readAndParseCSVData |