Simplest thing would be to start with the "Document based Perl app"
template. There are several ways you can get at the file's contents - as an
NSURL, an NSString local file path, an NSFileWrapper, or an NSData object.
All you do is get info on the target in Xcode, set up the extension
(.whatever) and set the document's UTI.

The UTI is a backwards-domain string similar to Java's package naming
scheme. So you'd probably use com.nytimes.dneville.ProjectName or something
similar. Once you've assigned the file type info, you'll have support for
the standard File menu, recent documents, and drag-n-drop support for
document files - it's all standard stuff, already built into Cocoa's
NSDocument architecture.

If you'd prefer not to use document-based apps, you can register as the
shared NSApplication's delegate, and handle the dropped files by responding
to the -application:openFile: and/or -application:openFiles: delegate
messages.

You can also configure your app to read and/or edit standard types like txt
or jpg, by using specific Apple UTIs, instead of UTIs based on your own
domain. For details about UTIs:

    <
http://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/understand_utis_intro/chapter_1_section_1.html
>

sherm--

On Jan 10, 2008 9:31 AM, Dan Neville <[EMAIL PROTECTED]> wrote:

> Hi,
> I am writing an application in Perl and compiling it in CamelBones.
> I want to make it a Drag&Drop.  I can't get the pasteboard to pass
> the file or folder information to the script.  Does anyone have an
> example I could use as a template?
>
> Am I correct in thinking that the link is in the pList?  I can't find
> this in any documentation.
>
> Thanks...
> Dan
> --
>
>
>

Reply via email to