Re: Sending data from contextual menu plugin to Cocoa app
Re: Sending data from contextual menu plugin to Cocoa app
- Subject: Re: Sending data from contextual menu plugin to Cocoa app
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 17 Dec 2007 16:13:11 +0100
Le 17 déc. 07 à 15:30, Aaron Vegh a écrit :
Hi there,
I'm writing an application that has two separate utilities: a main
Cocoa app, and a contextual menu item. I'd like the contextual menu
item to allow the user to select files for processing in the Cocoa
app; it would deliver the file's path into the Cocoa app.
However, as I've learned, contextual menu plugins are written in
straight C (see http://www.mactech.com/articles/mact...ins/index.html
for a tutorial). Ultimately you get down to the essential problem:
what C function will take a path name and fork it over to a Cocoa app?
I hope this is clearly explained... I barely understand hte problem
well enough to phrase a proper Google search! Further explanation
forthcoming if required.
Thanks,
Aaron.
You can call Cocoa code into a Contextual Menu plugin.
Just be sure to bracket your Cocoa call into autorelease pool
ContextualMenuCallBack(args) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
/* You obj-c code here */
NSTask *task = [NSTask task......];
[pool release];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden