• 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
Grabbing selected text in any app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Grabbing selected text in any app


  • Subject: Grabbing selected text in any app
  • From: Duncan Campbell <email@hidden>
  • Date: Wed, 26 Sep 2007 13:41:15 +1000

Hi Folks,

I'm writing a little helper app for my mac workmates to enable them to work better with windows paths - specifically to map windows network drive names to the equivalent mac mounts (so for example x: \foobar becomes /Volumes/DriveName/foobar). These links come in the form of links in emails, word documents, msn conversations etc. etc.

The approach I am taking is for them to be able to highlight the windows sharename, press a hot-key combination and then have finder open in the correct location using the mac equivalent.

I have this all working great - except right now I am getting them to copy the selected text to the pasteboard and then I read it from there.

My question is - is there any easy way for me to just grab the selected text in any application and work with it (rather than having to first copy it)? I've done a bit of searching and there's things like Text Extras etc. but I really don't want to make them install an frameworks/updates extensions etc. Additionally, I want this to work in all apps - that includes word, entourage etc - which aren't (afaik) using anything that's NSText-based. I did find a post on cocoabuilder asking the same question with a response suggesting to "Walk the responder tree" - but there was no sample code of how to do this? Is this even something that's possible?

Cheers for any direction,

D.

_______________________________________________

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


  • Follow-Ups:
    • Re: Grabbing selected text in any app
      • From: Scott Anguish <email@hidden>
  • Prev by Date: NSMenuItem: setState not working as expected
  • Next by Date: RE: Convenience Methods
  • Previous by thread: NSMenuItem: setState not working as expected
  • Next by thread: Re: Grabbing selected text in any app
  • Index(es):
    • Date
    • Thread