2016-06-19 69 views
0

我已經創建了一條規則,即當郵件按照某些標準進入郵件時,它們將移動到子文件夾中。 此外,我在這條規則中保存了這封郵件隨後複製到DMS中的AppleScript。 它正在工作。用於郵件規則的Applescript

我的問題是,子文件夾的名稱是(現在)沒有傳遞給腳本。它只包含「INBOX」:

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 

如何從活動郵件規則中獲取目標文件夾的名稱?

回答

0

而不是name獲得整個mailbox對象,它包含文件夾層次結構中的實際參考,以創建您需要參考的子文件夾。

set theMailbox to mailbox of theMessage 

PS:不需要tell application "Mail"塊,所述塊using terms足以評估的術語。

相關問題