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: Help -- how do I change the "to" "subject" of an open email in Mail? [Aside]




On 16 Jan 2007, at 01:54, Peter Payne wrote:

Any help from others on the list about how I can "write" the CC field of the current open Mail message would be greatly appreciated.

This is possible when scripting the creation of a new outgoing message, Peter. The following, for example, should work:


--------------

tell application "Mail"
	set new_message to make outgoing message ¬
		with properties {subject:"test", visible:true}
	
	tell new_message to make cc recipient ¬
		with properties {address:"email@hidden"}
end tell

--------------

However, a problem arises with messages that have been created manually, or have been saved, closed and then reopened. I'm afraid it's just one of a number of Mail scripting issues.

Until the situation improves, you might like to try a workaround that relies on GUI scripting (which should therefore be enabled):

--------------

set CC_address to "email@hidden"

tell application "System Events" to tell process "Mail"'s window 1
	tell text field 1 of scroll area 2 to if exists then
		set value of attribute "AXFocused" to true
		set value of attribute "AXValue" to CC_address
	end if
	tell scroll area -1 to if exists then ¬
		set value of attribute "AXFocused" to true
end tell

--------------

---
kai


_______________________________________________ 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/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Help -- how do I change the "to" "subject" of an open email in Mail? (From: Peter Payne <email@hidden>)
 >Re: Help -- how do I change the "to" "subject" of an open email in Mail? [Aside] (From: Adam Bell <email@hidden>)
 >Re: Help -- how do I change the "to" "subject" of an open email in Mail? [Aside] (From: Peter Payne <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.