Grabbing selected text in any app

  • 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.
  • have a look at services...

    http://developer.apple.com/documentation/Cocoa/Conceptual/SysServices/index
    .html#/

    /apple_ref/doc/uid/10000101i

    On Sep 25, 2007, at 11:41 PM, Duncan Campbell wrote:

    > 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.
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today