我正在編寫腳本以檢查是否提交了特定的Web表單。AppleScript和Mail.app:檢查新郵件是否包含字符串
劇本至今讀取正是如此:
tell application "Mail"
check for new mail
set newmail to get the unread count of inbox
repeat with msg in newmail
if msg's subject contains "New newsletter built by" then
return msg's subject
end if
end repeat
end tell
我在我的收件箱中的腳本一起工作了未讀電子郵件,但我仍然得到一個錯誤:
error "Mail got an error: Can’t make 1 into type specifier." number -1700 from 1 to specifier
任何將不勝感激。
乾杯!
除非您收到的所有消息在不到十分之一秒,你的腳本將不能正確每次工作,因爲'檢查新郵件'命令不會等待,所以** Mail **將不會有時間登錄到郵件服務器並檢索任何待處理的郵件。 – jackjr300
解決方案在我的答案 – jackjr300