• 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: Handling open as a result of spotlight search
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling open as a result of spotlight search


  • Subject: Re: Handling open as a result of spotlight search
  • From: The Karl Adam <email@hidden>
  • Date: Thu, 5 May 2005 19:00:09 -0400

Thanks for all the help everyone, here is the code that I used to get
at the search text;

		NSAppleEventManager *sam = [NSAppleEventManager sharedAppleEventManager];

		NSAppleEventDescriptor *lastEvent = [sam currentAppleEvent];
		NSString *searchString = [[lastEvent
descriptorForKeyword:keyAESearchText] stringValue];

Then you can use whatever method your application uses for searching
in order to highlight the search text.

-Karl

On 5/5/05, The Karl Adam <email@hidden> wrote:
> Thanks for the prompt response, but it seems that inorder to support
> this I need to handle the kAEOpenEvent instead of letting
> application:openFile: take care of it, unless I'm mistaken in how the
> AppleEvents work in Cocoa applications.
>
> Is there some way to just ask for the "current" or last apple event at
> a given time?
>
> -Karl
>
> On 5/5/05, Shawn Erickson <email@hidden> wrote:
> >
> > On May 5, 2005, at 3:16 PM, Shawn Erickson wrote:
> >
> > > "spotlight application launch"
> >
> > Make that "spotlight launch event"...
> >
>
 _______________________________________________
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

References: 
 >Handling open as a result of spotlight search (From: The Karl Adam <email@hidden>)
 >Re: Handling open as a result of spotlight search (From: Shawn Erickson <email@hidden>)
 >Re: Handling open as a result of spotlight search (From: Shawn Erickson <email@hidden>)
 >Re: Handling open as a result of spotlight search (From: The Karl Adam <email@hidden>)

  • Prev by Date: Re: Handling open as a result of spotlight search
  • Next by Date: Re: Tips on how to display NSArray of NSDictionaries using NSTreeController?
  • Previous by thread: Re: Handling open as a result of spotlight search
  • Next by thread: Re: Handling open as a result of spotlight search
  • Index(es):
    • Date
    • Thread