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: "Aaron Vegh" <email@hidden>
- Date: Mon, 17 Dec 2007 10:17:42 -0500
Salut Jean-Daniel,
Thanks for your reply! I was wondering if you knew of where I might
find some official documentation around this technique?
Cheers,
Aaron.
On Dec 17, 2007 10:13 AM, Jean-Daniel Dupas <email@hidden> wrote:
>
> 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];
> }
>
>
--
Aaron Vegh, Principal
Innoveghtive Inc.
P: (647) 477-2690
C: (905) 924-1220
www.innoveghtive.com
www.website-in-a-day.com
_______________________________________________
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