Re: How to get text of frontmost window in Mail?
Re: How to get text of frontmost window in Mail?
- Subject: Re: How to get text of frontmost window in Mail?
- From: Roger Howard <email@hidden>
- Date: Wed, 10 May 2006 14:19:06 -0700
On May 10, 2006, at 2:06 PM, Michelle Steiner wrote:
On May 10, 2006, at 1:51 PM, Roger Howard wrote:
I just need to get the selected text of the front-most window (a
new message). Barring that, I need to get the full text of that
window... preferably as styled text, but I can live with string or
Unicode or what have you.
You can't get the selected text without using GUI scripting and the
copy menu command. However, you can get the full text with the
following code:
tell application "Mail"
set the MessageText to the content of item 1 of (the selection as
list)
end tell
This gets the content of a currently selected message in the message
list, not the currently open (frontmost) message... of course this
could help, but it's a bit less direct than I hoped - I don't want
the user to have to save their message as a draft, then go to the
drafts folder and select it in the message list before I can get the
contents.
If all else fails I'll use GUI Scripting...
-R
_______________________________________________
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