AppleScript to Grab Attachment and Automatically 'Print' (i.e., Fax)

Posted:
in macOS edited January 2014


I'm attempting to create an AppleScript which will be used to grab an attachment from an email and then fax that attachment to a number specified in the email.  Essentially, the workflow is as follows:


 


User sends fax to [email protected] with a PDF attachment.  (FAXNUMBER is the number to which the document is to be faxed.)


All emails sent to @fax.example.com are routed to [email protected] which is configured in Mail.


When any email is received at [email protected], it runs an AppleScript.


 


What I need that AppleScript to do is strip FAXNUMBER from the to address and pass it off to OS X's built-in faxing functions and pass the PDF along as the actual document to be faxed.  Getting OS X to fax (which is basically treated the same as printing) an email when received is pretty easy, the issue I'm having is that I'm not sure how to strip the email from the front of the address and pass it along to the faxing functions.


 


Any ideas/suggestions?

Sign In or Register to comment.