• 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: How to accept drag of a URL on the dock icon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to accept drag of a URL on the dock icon?


  • Subject: Re: How to accept drag of a URL on the dock icon?
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 21 Dec 2013 18:48:39 -0600

For what it's worth, this is documented somewhat in Cocoa Scripting Guide: How Cocoa Applications Handle Apple Events – Apple Events Sent by the Mac OS – Open Contents.
https://developer.apple.com/library/mac/documentation/cocoa/conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html#//apple_ref/doc/uid/20001239-1121328

Cheers,
Ken

On Dec 21, 2013, at 5:22 PM, Andy Lee wrote:

> To answer my own question, it looks like it's done by implementing a Service.  I've gotten it working in a quick scratch application.
>
> --Andy
>
> On Dec 21, 2013, at 6:06 PM, Andy Lee <email@hidden> wrote:
>
>> I know how to accept files that are dragged from Finder to the application icon.  It's a matter of adding some settings to Info.plist and implementing the application:openFiles: application delegate method.
>>
>> This does not work for dragging URLs from a web browser -- for example, dragging from Safari's URL field, or dragging an image being displayed in Safari to the dock icon.  What happens is, my application:openFiles: method is never called, and the URL is given back to Safari to reload.
>>
>> Yet it is clearly possible for applications to accept dragging of URLs to their Dock icons, because it works for other browsers.  What are those other browsers doing?
>>
>> I tried using a custom contentView for the dock tile, and having that view be a drag destination (call registerForDraggedTypes: and implement NSDraggingDestination methods).  But that didn't make any difference.
>>
>> --Andy
>
>
>
> _______________________________________________
>
> 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


_______________________________________________

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


  • Follow-Ups:
    • Re: How to accept drag of a URL on the dock icon?
      • From: Andy Lee <email@hidden>
References: 
 >How to accept drag of a URL on the dock icon? (From: Andy Lee <email@hidden>)
 >Re: How to accept drag of a URL on the dock icon? (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: How to accept drag of a URL on the dock icon?
  • Next by Date: Sandboxing: Can't bookmark enclosing folder of user-selected file
  • Previous by thread: Re: How to accept drag of a URL on the dock icon?
  • Next by thread: Re: How to accept drag of a URL on the dock icon?
  • Index(es):
    • Date
    • Thread