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: kai <email@hidden>
- Date: Fri, 2 Sep 2005 00:26:09 +0100
On 31 Aug 2005, at 21:57, Charles Arthur wrote:
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.
[snip]
Any way to do this?
It seems that Mail (along with a crop of other Cocoa apps) doesn't
yet have this capability, Charles. Hopefully, there are plans to add
it at some point. In the meantime, I'm using a kludge:
---------------
on selectedText from p (* Mail, Safari, TextEdit, Address Book, etc. *)
tell application p to activate
tell application "System Events" to tell menu item "Copy" of
menu "Edit" of ¬
menu bar item "Edit" of menu bar 1 of process p to if
enabled then
tell application p to set c to the clipboard (* store
current clipboard *)
click
delay 0.4 (* allow time to copy: adjust as required *)
tell application p
if (count (clipboard info for string)) is 0 then
set s to ""
else
set s to the clipboard as string
end if
set the clipboard to c (* restore previous clipboard *)
return s
end tell
end if
""
end selectedText
selectedText from "Mail"
---------------
---
kai
_______________________________________________
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