【问题标题】:Applescript delete mail by subjectApplescript 按主题删除邮件
【发布时间】:2015-06-19 17:39:46
【问题描述】:

有没有办法按主题删除邮件,我正在尝试制作一个 Applescript,从我的“已发送”邮箱中删除具有特定主题的邮件。我已经用测试邮件尝试了这些脚本:

    tell application "Mail"
    set theMails to every message of (every mailbox whose name is "Sent") whose subject is "Test Mail"
delete theMails
    end tell

和:

tell application "Mail"
set theMails to {every message of inbox "Sent" whose subject is "Test Mail"}
delete theMails
end tell

两个脚本都不起作用,而且我不理解返回的错误,所以我找不到解决方案。求助!

【问题讨论】:

  • 你能发布错误吗?

标签: email applescript


【解决方案1】:

下面的代码有效。最好使用“包含”这个词,而不是尝试完全匹配主题

tell application "Mail"
    set theMails to {every message of sent mailbox whose subject contains "Test Mail"}
    delete theMails 
end tell

【讨论】:

  • 抱歉我打错了:删除“{”
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-03-09
  • 1970-01-01
  • 1970-01-01
  • 2017-08-31
  • 2022-08-03
  • 1970-01-01
  • 2014-08-11
相关资源
最近更新 更多