2014-07-17 165 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