Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Signature Automation



With the bugs inherent in mail's scripting functions, the only way to script it that I can see is to run a script that creates a new message with the desired signature, and then type the reply in that message.

This script should do it:

tell application "Mail"
set incoming to item 1 of (get the selection)
set _sender to the sender of incoming
set sender_name to (extract name from _sender)
set sender_addr to (extract address from _sender)
set _subject to the subject of incoming
if text 1 through 3 of _subject is not "re:" then set _subject to "Re: " & _subject
set _content to sender_name & " wrote:" & return & return & the content of incoming
set outgoing to (make new outgoing message with properties ¬
{subject:_subject, content:return & return & return & _content, visible:true})
set outgoing's message signature to signature "Truths"
-- Replace "truths" with the name of the signature your client will use
tell outgoing to make new to recipient with properties {name:sender_name, address:sender_addr}
end tell

Bruce Robertson wrote:

I have received the following request and have not yet looked into it
myself. Any comments?


Hi Bruce,
Mail.app is used by all 20 staff at one of my business clients. My
client is looking for a way to have one signature automatically
attached when sending NEW email messages while having a second
shorter signature automatically attached if they are replying to a
message.


_______________________________________________
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

I created this reply with the above script.

-- Michelle

-- 
From the cowardice that shrinks from new truth,
From the laziness that is content with half-truths,
From the arrogance that thinks it knows all truth,
O Goddess of Truth, deliver us.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.