• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Start application by dragging a file on it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Start application by dragging a file on it


  • Subject: Re: Start application by dragging a file on it
  • From: James McConnell <email@hidden>
  • Date: Sun, 20 Mar 2005 06:07:17 -0600

On 3/20/05 4:53 AM, "Hanspeter Spalinger" <email@hidden>
wrote:

> Hi to all.
>
> I wan't to create a cocoa application able to get started by simply
> dragging a file on it.
> How do I do that?
> In my present app I've created a delegate from NSApplication
> application:open, so it shouldbe able to open the file.
> My main problem is, that I don't know how to set up the Finder to
> accept dragging files on the application. It simply don't work. (The
> application don't go gray colored if the file is over it.
> Do I have to create a NSDocument application? But I only need to know
> the filepath and nothing else from the NSDocument class.
> I've too played around with Info.plist, but I didn't find a way.
> Is there a description for this in the developer Documentation.
>
> Sorry if this is a FAQ, but I didn't find something about it (I only
> find things about the drag and drop manager between running apps not
> start up.)
>
> Thanks for advice.
>
> Hanspeter


You need to register the filetype with your application.  If you inspect the
Target settings for your application, there should be a table for you to add
the filetypes to so your application knows it can handle them.  Even plain
text files have to be registered to open.

Hopefully someone else here can give you better directions; I'm not at my
development machine right now.

James

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Start application by dragging a file on it (From: Hanspeter Spalinger <email@hidden>)

  • Prev by Date: Re: newbie EXC_BAD_ACCESS
  • Next by Date: Re: newbie EXC_BAD_ACCESS
  • Previous by thread: Start application by dragging a file on it
  • Next by thread: Cocoa Bindings and multiple nibs
  • Index(es):
    • Date
    • Thread