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: Mon, 31 Jul 2006 03:04:55 +0100
On 31 Jul 2006, at 02:36, Michelle Steiner wrote:
On Jul 30, 2006, at 5:22 PM, kai wrote:
Thanks, but I found that keystroke "c" using command down fits my
needs.
Fine. If it's only for your own use, then losing any existing
clipboard contents may not matter that much.
Yup, but if I need to retain those contents, I can always store
them in a variable and then restore them to the clipboard.
Which was what the main part of my suggestion sought to do.
For anyone who _may_ be interested, the general-purpose handler below
(on which the earlier suggestion was based) is an updated version of
one I posted some time back.
----------------
on selected_text from app_name (* Mail, Safari, TextEdit, Address
Book, etc. *)
activate application app_name
tell application "System Events" to tell application process app_name
tell menu item "Copy" of menu "Edit" of menu bar item "Edit" of
menu bar 1
if not enabled then return ""
set current_clipboard to the clipboard as record
set the clipboard to {}
click
repeat while (the clipboard) is {}
delay 0.1
end repeat
set selected_text to the clipboard
set the clipboard to current_clipboard
end tell
end tell
selected_text
end selected_text
selected_text 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