• 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: How to get selected text in current application ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get selected text in current application ?


  • Subject: Re: How to get selected text in current application ?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 13 Jun 2001 11:11:44 -0700

On Wednesday, June 13, 2001, at 09:33 AM, Thierry Bucco wrote:

Hi,

Is there a way to get selected text in the current application and perform action with it.

Yes.

What you'll probably want to do is walk through the responder chain until you find an object that responds to -selectedRange, and then get the selected text from it with -RTFFromRange: (if you want the rich text attributes) or -string (if you just want the characters.)

If the text is not selected, you can use -setSelectedRange: to select it.

-jcr

(If this message looks like it has an attachment, your mail reader is brain-dead.)
begin


References: 
 >How to get selected text in current application ? (From: Thierry Bucco <email@hidden>)

  • Prev by Date: Re: Subclassing NSTextView and characters with diacritical marks
  • Next by Date: Re: Simple message passing between threads
  • Previous by thread: How to get selected text in current application ?
  • Next by thread: Rearranging tabs in NSTabView
  • Index(es):
    • Date
    • Thread