• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get selected text of message in Mail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get selected text of message in Mail?


  • Subject: Re: get selected text of message in Mail?
  • From: Martin Orpen <email@hidden>
  • Date: Tue, 1 Aug 2006 21:54:03 +0100

On 28 Jul 2006, at 5:06 pm, Michelle Steiner wrote:

An old message on this subject came up with this, among other, solutions for this problem.
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

However, this works only on incoming messages in the three panel view. It does not work if the message is displayed in its own window, nor in an outgoing message.


Does anyone have any suggestions for a universal solution, or at least one for an outgoing message?

That script looks like one of my hacks :-)

Mail is a PITA if you need to work with individual windows because AXSelectedText is replaced with the untouchable and unusable AXSelectedTextMarkerRange and AXStartTextMarker.

ISTR that you might not want to use the clipboard - so what are you actually doing with the selected text?

I like using control-click and tools like "On My Command" which can grab highlighted text from any app.

And the Services menu has always seemed ripe for hacking for something more useful than Script Editor=>Run As AppleScript. But, on reading the Developer Docs on Services, it looked far too complicated for the likes of me.

Regards

--
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


  • Follow-Ups:
    • Re: get selected text of message in Mail?
      • From: Michelle Steiner <email@hidden>
    • Re: get selected text of message in Mail?
      • From: kai <email@hidden>
  • Prev by Date: Deleting INBOX.msf for Netscape Email
  • Next by Date: Re: get selected text of message in Mail?
  • Previous by thread: Re: Deleting INBOX.msf for Netscape Email
  • Next by thread: Re: get selected text of message in Mail?
  • Index(es):
    • Date
    • Thread