AnsweredAssumed Answered

Fetch mail attachment with AppleScript

Question asked by MagalieJeune on Sep 17, 2018
Latest reply on Nov 26, 2018 by MagalieJeune

Hello,

I use a simple AppleScript to get one or more email from Mail.app in FileMaker.

It runs pretty well, except for rich text which is unfortunately "lost" in the process but I can live with it.

I try to add the email attachment to my record but I fail to do it.

 

I try this AppleScript :

 

try

tell application "Mail"

  set Sel to selection

  set Var to 1

  set Msg to item Var of Sel

  set Corps to content of Msg

  set listPJ to mail attachment of Msg

  set PJ to file Var of listPJ

on error errorMsg

  display dialog errorMsg

end try

 

And I get the error attached.

I tried in Script editor and in FileMaker and get of course the same issue.

 

Outcomes