FROM : Jerry LeVan
DATE : Fri Nov 01 20:38:03 2002
Earlier I requested assistance for launching an App by dragging a file onto
its icon ( and capturing the filename of the dragged file)
I have made a tiny bit of progress... If I paste:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSStringPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
Into the info.list, the application *will* launch when a file is dropped on
the app's icon!
I don't seem to be able to make the modified info.list permanent. Every time
I rebuild the app, the info.list looses the CFBundleDocumentTypes entry :)
Anyway it was suggested that I could capture the filename of the file
dropped on the app icon by implementing the application:openfile method,
here is what I added to the app:
- (BOOL) application: (NSApplication*) anApplication
openFile: (NSString* ) aFileName
{
// NSLog(@"Delegate invoked");
NSBeep();
theFile = [[[NSString alloc] initWithString:aFileName ] retain];
return YES;
}
Regretably, as far as I can tell (no beep) the method is not invoked by
dragging a file onto the app icon. It is not clear to me when the rascal
would be invoked ( before awakeFromNib ?)
What does everyone else know that I don't... (with respect to this problem).
Thanks...
Jerry
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Fri Nov 01 20:38:03 2002
Earlier I requested assistance for launching an App by dragging a file onto
its icon ( and capturing the filename of the dragged file)
I have made a tiny bit of progress... If I paste:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSStringPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
Into the info.list, the application *will* launch when a file is dropped on
the app's icon!
I don't seem to be able to make the modified info.list permanent. Every time
I rebuild the app, the info.list looses the CFBundleDocumentTypes entry :)
Anyway it was suggested that I could capture the filename of the file
dropped on the app icon by implementing the application:openfile method,
here is what I added to the app:
- (BOOL) application: (NSApplication*) anApplication
openFile: (NSString* ) aFileName
{
// NSLog(@"Delegate invoked");
NSBeep();
theFile = [[[NSString alloc] initWithString:aFileName ] retain];
return YES;
}
Regretably, as far as I can tell (no beep) the method is not invoked by
dragging a file onto the app icon. It is not clear to me when the rascal
would be invoked ( before awakeFromNib ?)
What does everyone else know that I don't... (with respect to this problem).
Thanks...
Jerry
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jerry LeVan | Nov 1, 20:38 | |
| ssudre2 | Nov 1, 20:47 |






Cocoa mail archive

