MACSCRPT Archives

July 2006

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:
Le Stang Jean-Baptiste <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sat, 1 Jul 2006 10:18:12 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (95 lines)
You can have a look to XMail (http://lestang.org/osax/XMail), it lets  
you compose a mail from a raw source, ie you could get the raw source  
of a mail written in Mail and send the raw source as this to the  
address of the secretary.

Here is quickly a script  that send the content of a mail to another  
person. I does not make the mail look like it has been forwarded but  
it should do the job of handling flawlessly the attachments for you.

tell application "Mail"
	set theMessage to item 1 of (get selected messages of message viewer 1)
	set theSource to get source of theMessage
end tell
send raw mail to {"[log in to unmask]", "[log in to unmask]"} from  
"[log in to unmask]" SMTP server "your.isp.com" raw source theSource

PS : XMail is free, open source, works under Mac OS X (10.3 & 10.4)
--
Jean-Baptiste LE STANG
On Jul 1, 2006, at 4:49 AM, Duane L. Mitchell wrote:

> On 6/30/06 3:40 PM  John Delacour  [log in to unmask]  said:
>
>> Mail used to have its own Scripts menu
>> but they removed it when they realised that nobody had yet managed to
>> write a useful script for Mail.
>
> Well I can't say the script I'm writing is useful because I was  
> trying to
> work around another shortcoming in Mail in that you can't create  
> rules to
> work on sent mail. You can do that with Entourage, maybe others.
>
> This law firm wants a copy of all email sent by their attorneys to be
> forwarded to a secretary who will print it and put a copy in the  
> file. They
> used to use Entourage until they put in a mail server and had  
> troubles with
> it. Then they switched to Mail. They are beginning to rue the day  
> they made
> that switch. Anyway, I created a script that basically made a new  
> email and
> formatted it to look like a forwarded email it and then flagged the  
> message
> so that it doesn't get sent again.
>
> So you're probably thinking if I'm creating and sending a new  
> message rather
> than forwarding an existing message doesn't that create a new sent  
> message
> in the sent folder with basically the same content? Well the answer  
> in Mail
> is maybe and sometimes but I don't know why. Oddly, when creating and
> sending an email with the AppleScript I developed you might not see  
> these
> messages show up in the sent folder. However, since these scripts  
> are run
> once a day first thing in the morning any new sent mail appears  
> unflagged at
> the top of the Sent folder and can be easily deleted by hand. Did I  
> mention
> I couldn't get the "delete" command to work on these new sent  
> messages? Well
> that's hard to work on when they don't always show up anyway.
>
> The script I created seemed to be working fine until it ran into an  
> email
> with an attachment. I would just like to have a reference to the  
> attachment
> in the existing email and so that I can attach it the new email. I  
> just
> don't see how the hell you can do that with this product. However  
> with Mail
> it's never just one problem to solve. Rather, any attempt at  
> scripting Mail
> seems to devolve into a complete and total morass of negativity. In  
> this
> case the script, when attempting to get the content of any email  
> that has an
> attachment also, for reasons I don't understand, truncates that  
> content
> seemingly at random points.
>
> There may be workarounds to these issues that someone may be aware  
> of and/or
> I might not be working with the scripting of Mail correctly.  
> However, it's
> easier to move on to another product rather than face the  
> uncertainty of
> this product and there's no doubt that this is an unfinished  
> product. No
> reason to use it.
>
> -Duane Mitchell

ATOM RSS1 RSS2