Saving Attachment from Mail.app
Saving Attachment from Mail.app
- Subject: Saving Attachment from Mail.app
- From: Alan Kimelman <email@hidden>
- Date: Fri, 21 Mar 2003 00:18:05 -0800
I would like to explore the issue of saving an attachment from Mail.app.
Although I have used the following script, successfully, I find that
writing the source of a mail message to a file significantly slows the
process. This script works, but is slow.
on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
repeat with eachMessage in selectedMessages
set s to source of eachMessage
end repeat
end tell
my writeSource(s)
end perform_mail_action
on writeSource(s)
set f to "" & (path to desktop) & "temp.txt"
set my text item delimiters to ASCII character 10
set ls to text items of s
set my text item delimiters to return
set s to ls as string
set my text item delimiters to ""
try
close access file f
end try
open for access file f with write permission
set eof file f to 0
write s to file f
close access file f
set DestinationFolder to (path to desktop)
tell application "Stuffit Expander"
Expand {alias f} Destination alias DestinationFolder
end tell
end writeSource
Some time ago, Cricket wrote that one can save the raw source of a
message to a file, and send a fileRef to Stuffit Expander, which
extracts the attachments.
I did not understand how to save the raw source of the message to a
file.
If this would accelerate the process, could someone explain that method?
Thanks
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.