【问题标题】:Applescript for mail rules邮件规则的 Applescript
【发布时间】:2016-06-19 07:22:30
【问题描述】:

我创建了一个规则,当邮件根据特定条件移动到子文件夹时。 此外,我在此规则中保存了一个 AppleScript,此邮件随后将其复制到 DMS 中。 它正在工作。

我的问题是,子文件夹的名称(目前)没有传递给脚本。它只包含“收件箱”:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"
            repeat with theMessage in theMessages
                set nameAccount to name of mailbox of theMessage  # here is the problem !
                try
                    tell theMessage
                        — at this point get the data out of the mail
                    end tell
                    tell application id „DMS“
                        — here the  data will save to the dms
                    end tell
                end try
            end repeat
        end tell
        #            end try
        #        end tell
    end perform mail action with messages
end using terms from

如何从活动邮件规则中获取目标文件夹的名称?

【问题讨论】:

    标签: applescript


    【解决方案1】:

    而不是 name 获取整个 mailbox 对象,它包含文件夹层次结构中的实际引用,要创建一个子文件夹,无论如何您都需要引用。

    set theMailbox to mailbox of theMessage
    

    PS:tell application "Mail" 块不是必需的,using terms 块足以评估术语。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      • 2017-01-23
      • 2014-11-15
      • 2016-07-07
      相关资源
      最近更新 更多