• 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: Want to get filename for images dragged from Finder and from Safari / Firefox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Want to get filename for images dragged from Finder and from Safari / Firefox


  • Subject: Re: Want to get filename for images dragged from Finder and from Safari / Firefox
  • From: Bryan Prusha <email@hidden>
  • Date: Wed, 17 Aug 2005 13:57:16 -0700


On Aug 17, 2005, at 12:47 PM, Adam Holt wrote:

I've got an NSImageView that I've subclassed in order to post a notification
of the filename of any images that are dropped on it.


My problem is that:
[pboard stringForType:NSFilenamesPboardType]
only gives me filenames for locally dragged files (from Finder), but I also
want to get a filename when I drag and drop in images from a browser.


I tried using [pboard stringForType:NSURLPboardType] instead, which works
better, i.e. it gives me the local filename (in file:// form), and gives me
the URL of images dragged from a browser EXCEPT when those images are
themselves links, in which case it gives me the URL that the image is linked
to and not the URL of the image itself which is of course what I need in
order to workout the filename.


Does anybody have a solution that could work for both local images and web
images?

Safari supplies "Apple URL pasteboard type" and "NSStringPboardType" that both contain the name of the file. The image file appears to be provided as a "promised file" which is why the NSFilenamesPboardType doesn't exist.


_______________________________________________
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: 
 >Want to get filename for images dragged from Finder and from Safari / Firefox (From: Adam Holt <email@hidden>)

  • Prev by Date: RE: NSApplicationMain() doesn't set NSApp to my subclass
  • Next by Date: Re: Dependent Keys
  • Previous by thread: Want to get filename for images dragged from Finder and from Safari / Firefox
  • Next by thread: Anyone used iTableColumnHeader?
  • Index(es):
    • Date
    • Thread