2014-07-17 221 views
1

所有文件夹& outlook的子文件夹(下面列表)传递给applescript变量(selectedMessages)。在苹果脚本中设置文件夹和子文件夹

任何方式通过一个一个或所有的文件夹在苹果脚本(使用苹果)。 Outlook邮件文件夹的

文件夹结构:

SIGMACO 
    Inbox 
    -McAfee Anti-Spam 
    Drafts 
    Sent Items 
    Deleted Items 
    Junk E-mail 
    RSS Feeds 
    Sync Issues 
    -Conflicts 
    -Local Failures 
ON MY COMPUTER 
    Inbox 
    Drafts 
    Sent Items 
    Deleted Items 
    Junk E-mail 
    archive PST 
    -Deleted Items 
    -Sent Items 
SMART FOLDERS 
    Flagged Mail 

+++++++++++

tell application "Microsoft Outlook" 
    with timeout of 8.8E+8 seconds 
    set selectedMessages to every messagge of folder "deleted Items" of on my coputer 
    end timeout 
end tell 
+0

对不起,我不明白你在做什么。我看到你想选择垃圾桶中的每一件物品。我不知道为什么,也不知道“子文件夹的设置文件夹”是什么意思,你是否想将这些消息移动到子文件夹的文件夹中? – mcgrailm

+0

请检查updeted quetion&谢谢你的回复。 – AtmiyaDas2014

回答

1

找到列表foldeer和subfoldeeer一些代码。

global AllFolders 

set AllFolders to {} 

global ContainerName 

set ContainerName to "" 

tell application "Microsoft Outlook" 

    set allMailFolders to get mail folders 

    repeat with currentFolder in allMailFolders 

     set FolderName to name of currentFolder 

     set PathSoFar to "" 

     if FolderName is not missing value and (container of currentFolder is not missing value or account of currentFolder is not missing value) then 

      set ContainerName to ":" 

      set theContainer to currentFolder 

      repeat while ContainerName is not "" 

       set ContainerName to "" 

       try 

        set theContainer to container of theContainer 

        set ContainerName to name of theContainer 

        if ContainerName is missing value then 

         set theAccount to account of theContainer 

         if theAccount is not missing value then 

          set AccountName to name of theAccount 

          set PathSoFar to (AccountName) & ":" & PathSoFar 

         end if 

        else 

         set PathSoFar to (ContainerName) & ":" & PathSoFar 

        end if 

       end try 

      end repeat 

      set end of AllFolders to {PathSoFar & ":" & (FolderName)} 

     end if 

    end repeat 

return AllFolders 

end tell