MACSCRPT Archives

February 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Herb Schilling <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 9 Feb 2007 09:55:51 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
On Feb 8, 2007, at 10:00 PM, MACSCRPT automatic digest system wrote:

>
>> ... I have not discovered in the Mail.app Dictionary any command
>> that moves an attachment from inside Mail to outside Mail. That is
>> to say, I am unable to get the "move", "make" and "save" commands to
>> do anything that comes near to what the aforementioned Save button
>> accomplishes. Any suggestion?

Hi,

  This works for me.

set folderAlias to choose folder "Where do you want to put the  
attachments?"
tell application "Mail"
	set theMessages to selected messages of first message viewer
	repeat with theMessage in theMessages
		if theMessage's mail attachments is not {} then
			repeat with theAttachment in theMessage's mail attachments
				set theFileName to (folderAlias as string) & theAttachment's name
				try
					save theAttachment in theFileName
				on error errnum
				end try
			end repeat
		end if
	end repeat
	
end tell


-----------------------
Herb Schilling
[log in to unmask]

ATOM RSS1 RSS2