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