Re: Obtaining data from finder drag onto cocoa application....
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.