• 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: Sending text to frontmost app and active text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending text to frontmost app and active text field


  • Subject: Re: Sending text to frontmost app and active text field
  • From: KLW <email@hidden>
  • Date: Wed, 07 Jan 2004 10:56:44 -0500

Michael Deninger wrote:
I would like to send a text string (NSString) to the front most application running (whatever that might be) and have it insert into the active text field.
This doesn't sound like a good user experience to me. I would hate to be typing away in Mellel or SubEthaEdit and suddenly have some alien text string inserted between "Dear" and "Mom".

What would be the best way to accomplish this. I suppose I could use Applescript, but I don't want to be dependent on this.
Actually, I think AppleScript is the perfect way to do it. Just send your text string to the frontmost app wrapped in a try statement (in case the app doesn't accept text input). You'll always be dependent on something being on the system, so why not AppleScript? (Unless of course you have a way of convincing all major application makers --Microsoft, Adobe, etc--to listen for notification that you want to insert your NSString.)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: NSToolbar Problem
  • Next by Date: Re: CopyWithZone required ?
  • Previous by thread: Re: Cocoa Application Without GUI
  • Next by thread: Re: Sending text to frontmost app and active text field
  • Index(es):
    • Date
    • Thread