Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Image name for drag and drop from Safari



Hi,
Thanks for your reply, Clipboard viewer did the trick,
Its the NSRTFDPboard type that contains the required data.

// Get the rtfd data, get the attachment and then get the attachment name from it
NSData *nameData = [[sender draggingPasteboard] dataForType:NSRTFDPboardType];
NSAttributedString *string = [[[NSAttributedString alloc] initWithRTFD:nameData documentAttributes:nil]autorelease];
NSTextAttachment *attachment = [string attribute:NSAttachmentAttributeName atIndex:0 effectiveRange:NULL];
NSString *name = [[attachment fileWrapper] filename];


-Chaitanya

On 18-Jul-08, at 10:48 AM, Gary L. Wade wrote:

Launch the Clipboard Viewer, which is in:

   /Developer/Applications/Utilities/Built\ Examples/

and drop your images onto it, and then select the Drag Clipboard, possibly clicking Reload to inspect the values you can get.

Hi,
In my application, i allow users to drag and drop images from Safari,
however while receiving the drop i cannot retrieve the image name from
the pasteboard.
If i get the data for URL pasteboard type, it gives the URL up to the
image, and not containing the image, what i mean is,


if the image is located at suppose http://www.somesite/something/image.tiff
, the URL pasteboard gives http://www.somesite/something/
But  i need the "image.tiff"

I'd appreciate any help.
Thanks
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden


This email sent to email@hidden
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >RE: Image name for drag and drop from Safari (From: "Gary L. Wade" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.