0
我正在嘗試編寫一個執行以下任務的腳本:它會通過郵箱中的所有電子郵件,找到在其主題中包含「法語」一詞的電子郵件然後將這些電子郵件的所有主題行復制到文本文件中。以下是我想出了過濾收件箱中電子郵件主題行的Applescript
tell application "TextEdit"
make new document
end tell
tell application "Mail"
tell the mailbox "Inbox" of account "[email protected]"
set numm to count of messages
repeat with kk from 1 to numm
set wordsub to subject of the message kk
tell application "TextEdit"
if "French" is in wordsub then
set paragraph kk of front document to wordsub & return
end if
end tell
end repeat
end tell
end tell
不幸的是,我不斷收到錯誤
"TextEdit got an error: The index of the event is too large to be valid."
,我已經花了幾個小時試圖修復它沒有取得多大成功。你可以看看我的代碼,看看它有什麼問題嗎?
非常感謝,也爲解釋。我只是測試它,它的工作原理! – user1227