Re: How to get the word under the mouse pointer?
Re: How to get the word under the mouse pointer?
- Subject: Re: How to get the word under the mouse pointer?
- From: John Stiles <email@hidden>
- Date: Thu, 06 Dec 2007 19:59:57 -0800
I think you can do things like this with a Service (not a faceless app).
James Chen wrote:
Hello,
Thanks but what if the front most application is not mine.
Sorry that I didn't describe my question well.
I'd like to write a faceless application that provides a service similar to
"Look up in Dictionary" which is invoked by global hot key and is related to
the text/word under mouse pointer. So I don't think I'm able to get the
NSTextView instance of active app.
Best Regards,
James Chen
Presentation Product Division
TEL: +886 2 22263630 ext 8538
FAX: +886 2 22267241
Mailto: email@hidden
http://www.avermedia.com
AVerMedia Technologies, Inc.
簡報產品事業單位: 陳銘崧
圓剛科技(股)公司
This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive messages for the
addressee), you cannot use, copy or disclose to any third party or any
information contained in the message. If you have received the message in
error, please advise the sender by reply e-mail and delete the message.
Nothing in this message should be interpreted as a digital or electronic
signature that can be used to authenticate a contract or to other legal
document. Thank you very much.
From: Tommy Nordgren <email@hidden>
Date: Fri, 7 Dec 2007 04:14:49 +0100
To: James Chen <email@hidden>
Cc: Cocoa <email@hidden>
Subject: Re: How to get the word under the mouse pointer?
On 7 dec 2007, at 03.16, James Chen wrote:
Hi all,
I'd like to do something like "Look up in Dictionary" (crtl + cmd +
D by
default), which will display a dictionary panel according to the
word under
the mouse.
Does anyone know how to do it?
Any idea will be very appreciated!
Thanks.
Best Regards,
James Chen
Presentation Product Division
TEL: +886 2 22263630 ext 8538
FAX: +886 2 22267241
Mailto: email@hidden
http://www.avermedia.com
AVerMedia Technologies, Inc.
Call the following NSTextView method:
characterIndexForInsertionAtPoint:
Then scan scan backwards and forwards in the text for word boundaries.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden