Re: export e-mail attachments
Re: export e-mail attachments
- Subject: Re: export e-mail attachments
- From: John Delacour <email@hidden>
- Date: Mon, 3 Mar 2003 19:48:10 +0000
- Mac-eudora-version: 6.0a8
At 10:39 am -0800 3/3/03, Jeremy Sellors wrote:
Well that script works OK. Thanks John.
When I get to play with this a bit I have another idea, but first
let me explain what I am trying to do.
E-mails come in to Mail.app with PDF, Image or .doc (Word) etc
attachments used to make up an ad. I want to export this e-mail and
attachments (or attachment name and path info) to a new record in a
FMPro document. this can then be linked to a clients Insertion Order
for reference and further processing.
Now if I import all the MIME source of the e-mail into a text field.
This includes the attachment code.
Would it be possible to parse this code with an Applescript or Perl
like your EXTRA STUFF piece or even using FMPro calculation to get
the attachments?
The reason I suggested all that palaver was that Mail gives "?" when
you ask for the content of a message that contains only an
attachment, so you don't actually get the content but Mail's special
definition of content. You can't get its 'text' at all, but you can
get the 'source' and write this to a file that you can then parse
with perl. Don't try it with a string in do shell script or it'll
break. You must read from a file.
set f to "/tmp/temp.txt"
set fMac to POSIX file f
tell app "Mail"
selection
first item of result
set s to source of result
end tell
try
close access fMac
end try
open for access fMac with write permission
set eof fMac to 0
write s to fMac
close access fMac
-- ______________________
do shell script "perl -e'
$f = q~" & f & "~ ;
open F, $f or die $! ;
while (<F>) {
\" parse the file line by line here \" ;
print ;
} '"
-- JD
_______________________________________________
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.