• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mail and Attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail and Attachments


  • Subject: Re: Mail and Attachments
  • From: "Automated Workflows, LLC Mailing Lists" <email@hidden>
  • Date: Thu, 25 Aug 2005 12:43:26 -0400

In Mail, an attachment is not an element of a message, it is an element of the content of a message. That said, the following code seems to work for me now to save attachments from Mail in Tiger.

set theOutputFolder to (choose folder) as string
tell application "Mail"
    set theSelection to selection
    set theMessage to item 1 of theSelection
    set theAttachments to every attachment of content of theMessage
    repeat with a from 1 to length of theAttachments
        set theAttachment to item a of theAttachments
        try
            set theAttachmentName to name of theAttachment
            set theSavePath to theOutputFolder & theAttachmentName
            save theAttachment in theSavePath
        end try
    end repeat
end tell

-Ben

Benjamin S. Waldie
President & CEO
Automated Workflows, LLC
610.935.0652
=============================================
AppleScript and Workflow Automation
Consulting - <http://www.automatedworkflows.com>
AppleScript Info - <http://www.applescriptguru.com>
AppleScript Training - <http://www.applescripttraining.com>
=============================================

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Mail and Attachments
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Mail and Attachments (From: Martin Orpen <email@hidden>)
 >Re: Mail and Attachments (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: lauch script via keyboard shortcut
  • Next by Date: Re: on idle() handler in script object
  • Previous by thread: Re: Mail and Attachments
  • Next by thread: Re: Mail and Attachments
  • Index(es):
    • Date
    • Thread