• 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: Obtaining data from finder drag onto cocoa application....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining data from finder drag onto cocoa application....


  • Subject: Re: Obtaining data from finder drag onto cocoa application....
  • From: David Remahl <email@hidden>
  • Date: Tue, 12 Feb 2002 12:01:23 +0100

> Hello,
> I would like to obtain volume/file/folder data using a finder drop onto my
> cocoa application. I have tried setting a handler for kCoreEventClass,
> using both kAEOpenDocuments and kAEOpenApplication Event ID's. If I send
> either of these specified events from a test script, my handler is called
> just as it should be. However, if I drag a file/folder/volume onto my
> application to launch it, the application does launch (as my doc types are
> set in the PB target info) but my handler is never called. Any ideas?
>
> Also, note: This is not a document based application and I do not wish to
> open my finder selections in such a way. I'm simply interested in their
> respective paths on the hard disk.
>
Handle your drop Cocoa-style, in your application's degelate's:


- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
{
// do whatever you like with filename, this method will be called
repeatedly for all dropped files.

return YES;
}

/ David
_______________________________________________
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.

References: 
 >Obtaining data from finder drag onto cocoa application.... (From: Michael Emfinger <email@hidden>)

  • Prev by Date: Re: how to use Cocoa Java from Cocoa Obj-C code?
  • Next by Date: Re: how to use Cocoa Java from Cocoa Obj-C code?
  • Previous by thread: Obtaining data from finder drag onto cocoa application....
  • Next by thread: how to use Cocoa Java from Cocoa Obj-C code?
  • Index(es):
    • Date
    • Thread