我有我們的辦公室用於計劃的電子表格。每個標籤代表一個月。我可以每個選項卡導出到文件名爲month1.csv,month2.csv ......等等,我有以下的代碼,通過它打開每個文件月份環:applescript文件名錯誤
repeat with b from 1 to 12
tell application "Finder"
set curFileName to (sourceFolder & "month" & b & ".csv") as string
--display dialog curFileName
set workingFile to read file (curFileName)
--display dialog "File has been read"
set AppleScript's text item delimiters to {ASCII character 13}
set theContents to text items of workingFile as list
end tell
do stuff with the csv...
end repeat
腳本迭代通過第一個月,然後當b = 2我得到這個錯誤:
Finder got an error: File file Macintosh HD:Users:lorenjz:Documents:Manpower:,month,2,.csv wasn’t found.
我需要做什麼來消除這個錯誤?