2016-06-19 6 views
0

私は、特定の基準に従ってメッセージがサブフォルダに移動するというルールを作成しました。 さらに、このルールでは、このメールを後でDMSにコピーするAppleScriptを保存しました。 これは機能しています。Applescript for mail rules

私の問題は、サブフォルダの名前が(今のところ)スクリプトに渡されていないということです。 「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ブロックは、専門用語を評価するのに十分です。

関連する問題