• 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: Saving Attachements to a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving Attachements to a folder


  • Subject: Re: Saving Attachements to a folder
  • From: has <email@hidden>
  • Date: Mon, 20 Aug 2007 20:21:35 +0100

Ronald Hofmann wrote:

I´m trying to save the attachement of a mail (selection) to a folder.
[...]
Could somebody point me to the right direction?

set folderPath to "MacOSX:Users:ronny:Desktop:Target:"

tell application "Mail"
repeat with msgRef in (get selection)
repeat with attachmentRef in mail attachments of msgRef
set filePath to (folderPath & name of attachmentRef) -- note: assumes attachment name doesn't contain colons
save attachmentRef in filePath -- note: will raise an error if file already exists
end repeat
end repeat
end tell


HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Saving Attachements to a folder
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Saving Attachements to a folder
  • Next by Date: Re: Saving Attachements to a folder
  • Previous by thread: Re: Saving Attachements to a folder
  • Next by thread: Re: Saving Attachements to a folder
  • Index(es):
    • Date
    • Thread