0

我想使用 Apple 脚本循环遍历 MAC 计算机中 Outlook 2011 的所有文件夹(意味着某种自动化)。

我有运行时抛出错误的脚本。

 tell application "Microsoft Outlook"
   set thisAccount to exchange account "Sigmaco"
   set thisFolders to mail folder of thisAccount
 end tell

 *tell application "Microsoft Outlook" to set folderList to the folders*

 repeat with nextFolder in folderList
    my ProcessFolder(nextFolder, outputFolder)
 end repeat

但是粗体样式的行会引发错误,即它无法遍历所有文件夹。

请帮忙...

4

1 回答 1

2

因为帐户可以具有相同的名称(假设)您必须指定第一个然后像这样向下钻取

tell application "Microsoft Outlook"
    repeat with afolder in (mail folders of (first exchange account whose name is "Sigmaco"))
        log (get name of afolder)
    end repeat
end tell

如果您想遍历所有帐户的所有文件夹,您可以跳过一些钻探

tell application "Microsoft Outlook"

    repeat with afolder in mail folders
    -- do stuff
    end repeat
end tell
于 2014-07-08T17:17:04.147 回答