我正在尝试获取一行 CSV 并从中提取一项,这里有一些代码:
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"}
谁能告诉我为什么会发生这个错误?