私はCSVの1行を取り、そこから1つのアイテムを抽出しようとしています:
tell application "Finder"
set workingFile to (open for access outPath)
set theContents to read workingFile using delimiter {ASCII character 13} as list
end tell
set rowTwo to item 2 of theContents as list
close access workingFile
set AppleScript's text item delimiters to {","}
set rowParts to (every text item in rowTwo) as list
display dialog rowParts
set secondItem to item 2 of rowParts
display dialog "The second item is: " & secondItem
プログラムを実行しようとすると、次のエラーが発生しますset secondItem to item 2 of rowParts
。
Result:
error "Can’t get item 2 of {\"Date,Day,Zimmer,Graves,Randolph,Dempsey,Hannah,DeVaughn,,GSA 0034G,GSA 0035G,48' Trailer1,48' Trailer2,53' Trailer\"}." number -1728 from item 2 of {"Date,Day,Zimmer,Graves,Randolph,Dempsey,Hannah,DeVaughn,,GSA 0034G,GSA 0035G,48' Trailer1,48' Trailer2,53' Trailer"}
そのエラーが発生する理由を誰か教えてもらえますか?