【问题标题】:Applescript move Outlook email to sub folderApplescript 将 Outlook 电子邮件移动到子文件夹
【发布时间】:2014-09-15 22:46:19
【问题描述】:

我正在使用 Applescript 通过为 Applescript 分配键盘快捷方式将 Outlook 中的电子邮件移动到文件夹。这很好用,我正在尝试创建另一个脚本,但将我收件箱中的电子邮件移动到不在我收件箱正下方的子文件夹中。

查看下面的脚本。注释掉的行有效,但我尝试分配子文件夹的行中断了。

如何在 Applescript 中分配子文件夹?我正在通过“/”尝试“MyFolder/MySubfolder”,但这不起作用。

on run {}
tell application "Microsoft Outlook"
    activate
    set msgSet to current messages
    if msgSet = {} then
        error "No messages selected. Select at least one message."
        error -128
    end if
    set theMsg to item 1 of msgSet
    set theAccount to account of theMsg
    --set archiveFolder to folder "MyFolder" of folder "Inbox" of theAccount
    set archiveFolder to folder "MyFolder/MySubfolder" of folder "Inbox" of theAccount
    repeat with aMessage in msgSet
        move aMessage to archiveFolder
    end repeat
end tell

结束运行

【问题讨论】:

    标签: email outlook applescript subdirectory


    【解决方案1】:

    好的,我想通了!

    set topFolder to folder "Inbox" of theAccount
    set subFolder to folder "MyFolder" of topFolder
    set subFolder2 to folder "MySubfolder" of subFolder
    

    【讨论】:

      【解决方案2】:

      你把它们用长手和相反的方式串起来;

      例如,

      set archiveFolder to folder "MySubfolder" of folder "MyFolder" of folder "Inbox" of theAccount
      

      【讨论】: