Re: Safari bookmarks...
Re: Safari bookmarks...
- Subject: Re: Safari bookmarks...
- From: Jerry Krinock <email@hidden>
- Date: Sat, 9 Feb 2008 07:25:47 -0800
On 6 Feb 2008, at 12:23, Amit8 J wrote:
I need a bit of help. I am working on an application where I need to
catch dragged and dropped bookmarks from safari.
Is there some way I can get the URLs of all the dragged and dropped
bookmarks. Any help would be appreciated.
Sorry I missed your message when you first posted it. It is not
documented, but quite obvious and easy to do. Just accept and get the
pboard type @"BookmarkDictionaryListPboardType".
<snip>
NSString* const SafariBookmarkItemPboardType =
@"BookmarkDictionaryListPboardType" ;
</snip>
<snip>
else if([pboard availableTypeFromArray:[NSArray
arrayWithObjects:SafariBookmarkItemPboardType, nil]]) {
NSArray *safariItems = [pboard
propertyListForType:SafariBookmarkItemPboardType] ;
</snip>
The array safariItems is an array of NSDictionaries. Each
NSDictionary is the root of a tree of dropped items. Traverse the
"Children" key recursively to get all the children.
On Feb 6, 2008 3:27 PM, Citizen <email@hidden> wrote:
For Internet Location files dragged from finder you can use
"NSFilenamesPboardType" to get the files, then you can scan each file
for the URL. You have to use Carbon to look in the files resource fork
data for the URL though.
Indeed, I've done this too and it was much more painful.
_______________________________________________
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