• 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
Mail "get attachment" broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mail "get attachment" broken?


  • Subject: Mail "get attachment" broken?
  • From: Neil Faiman <email@hidden>
  • Date: Mon, 21 Nov 2005 21:37:35 -0500

A few weeks ago, based on some useful information on this list, i rewrote one of my scripts to use Mail's "attachment" to get mail attachments (as opposed to my old script, which saved the message, and then ran it through Stuffit to extract the attachment).

Today, I tried to run this script, and it failed miserably. After observing that this fragment wasn't saving the attachment into the minutesFolder:

repeat with anAttachment in (get every attachment of content of theMessage)
try
if name of anAttachment contains "Minutes" and name of anAttachment ends with ".doc" then
set fileName to tempFolderName & (name of anAttachment)
save anAttachment in fileName
tell application "Finder" to set end of minutesFiles to (file fileName)
end if
end try
end repeat

I wrote up this minimal reproducer:

on run
tell application "Mail"
set theSelection to the selection
set theMessage to item 1 of theSelection
set a to (get every attachment of content of theMessage)
end tell
end run

Lo and behold, when I run it in Script Editor, my result pane shows 

{application "Mail"}

Has something changed in Mail scripting in 10.4.3 or some other recent update?

Thnaks,

Neil Faiman

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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 "get attachment" broken?
      • From: Neil Faiman <email@hidden>
  • Prev by Date: Re: Startup, shutdown
  • Next by Date: Re: Startup, shutdown
  • Previous by thread: [ann] aemreceive 0.1.1
  • Next by thread: Re: Mail "get attachment" broken?
  • Index(es):
    • Date
    • Thread