2016-10-05 8 views
0

多くのvcardが電子メールで自動的に受信され、自動的に連絡先にインポートします。添付ファイルをメールからダウンロードするにはどうすればよいですか?

私はvcardファイルを開き、連絡先をインポートするAppleScriptをコーディングしました。しかし、まずファイルをダウンロードする必要があります。

しかしAppleScriptとメールのルールを使用して電子メールから添付ファイルをダウンロードするにはどうすればよいですか?

ありがとうございます。

乾杯、 クリス

答えて

1

は、スクリプト怒鳴る先フォルダに電子メールを選択して添付ファイルを保存します。これらのファイルを使用してアドレス帳に追加することができます。

set Dest to ((path to desktop folder) as string) & "FMail:" -- the folder to save attached files 
tell application "Mail" 
activate 
set ListMessage to selection -- take all emails selected 
repeat with aMessage in ListMessage -- loop through each message 
    set AList to every mail attachment of aMessage 
    repeat with aFile in AList --loop through each files attached to an email 
     if (downloaded of aFile) then -- check if file is already downloaded 
      set Filepath to Dest & (name of aFile) 
      save aFile in Filepath as native format 
     end if 
    end repeat -- next file 
end repeat -- next message 
end tell 

私はそれを明確にするために多くのコメントを追加しました。それをあなたのニーズに適応させることができます。

+0

問題をここで解決しました:[link](http://stackoverflow.com/questions/39509518/add-vcard-to-contacts-with-mail-rules-and-applescript) おかげで@pbell –

関連する問題