Re: get selected text of message in Mail?
Re: get selected text of message in Mail?
- Subject: Re: get selected text of message in Mail?
- From: Martin Orpen <email@hidden>
- Date: Fri, 02 Sep 2005 08:06:06 +0100
on 2/9/05 01:03, Matt Neuburg at email@hidden wrote:
> On Wed, 31 Aug 2005 21:57:16 +0100, "Charles Arthur, UKClimbing Editor"
> <email@hidden> said:
>> OK, I can't figure it out. Is it feasible?
>>
>> In Eudora (where yes, I enjoy changing the subject line... oh, that's
>> another topic, isn't it?) one can do
>>
>> set thetext to selected text
>>
>> and get, well, the text you've selected in whatever message you're looking
>> at.
>>
>> However I've found nothing comparable in Mail.
>>
>> You can get the whole text of a message -
>> set foo to the selection
>> set foo to item 1 of foo
>> set thetext to (content) of foo
>> (inside a Mail tell block of course)
>>
>> but things like "selected text of content" don't compile, "selection of
>> content" doesn't make sense (because "selection" applies to the mail
>> messages window).
>>
>> Any way to do this?
>
> No. m.
How about:
activate application "Mail"
tell application "System Events"
tell process "Mail"
get value of attribute "AXSelectedText" of text area 1 of scroll
area 2 of splitter group 1 of window 1
end tell
end tell
Works for me in Tiger :)
--
Martin Orpen
_______________________________________________
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