• 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: Text Capture in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Capture in Cocoa


  • Subject: Re: Text Capture in Cocoa
  • From: Yaogang Lian <email@hidden>
  • Date: Thu, 15 Jun 2006 20:15:34 -0400

Thanks for reply, John.

The accessibility API is quite useful for grabbing info from UI elements, but it seems to
be unable to grab a single word. For example, when I point the mouse to a word
in a web page, the accessibility API returns either all the texts in a paragraph or selected
texts. I hope to be able to grab a single word without actually selecting it. This seems to
be a more tricky task.


Yaogang

On Jun 15, 2006, at 7:57 PM, John C. Randolph wrote:


On Jun 15, 2006, at 12:05 PM, Yaogang Lian wrote:

Hi all,

I am developing a dictionary and want to support text capture using the mouse.
I want to hover the mouse over any text on the screen (be it on a button, on a web page,
in a document, or in Finder), and capture that word in my program, then translate it.


For a real feeling, just try Apple's own dictionary: hover your mouse over any word
in a document or web page, and press "Apple + Ctrl + D", a floating panel will appear and
show the explanation of the word. That's the behavior I want to implement.


Is there any Cocoa API that I can use to grab the word under the mouse? Do I need to
intercept the drawing APIs? How can I do it?


Any advice is appreciated.

I think what you want is in the accessibility API.

-jcr


"The right to be heard does not include the right to be taken seriously." - Hubert Humphrey



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Text Capture in Cocoa
      • From: Bill Cheeseman <email@hidden>
    • Re: Text Capture in Cocoa
      • From: Eric Schlegel <email@hidden>
References: 
 >Text Capture in Cocoa (From: Yaogang Lian <email@hidden>)
 >Re: Text Capture in Cocoa (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: User-only preference pane
  • Next by Date: Re: User-only preference pane
  • Previous by thread: Re: Text Capture in Cocoa
  • Next by thread: Re: Text Capture in Cocoa
  • Index(es):
    • Date
    • Thread