Accepting non-file drags in the Dock

  • I see that some applications can accept a drag of what I assume are
    some pasteboard types on their Dock icon. For example, Safari can
    accept URLs (opens them) and strings (looks them up on Google unless
    they're URL-ish).

    I can't find a NSApplication delegate method to accept this kind of
    drop. Is there any Cocoa thing I'm missing, or is it something that
    must be done with non-Cocoa APIs? Apple Events? Carbon events?

      - ∞
  • I guess this plist entry has something to do with it:

    (...)
    <key>CFBundleDisplayName</key>
    <string>TextEdit</string>
    <key>CFBundleDocumentTypes</key>
    <array>
    (...)
      <dict>
      <key>CFBundleTypeName</key>
      <string>NSStringPboardType</string>
      <key>CFBundleTypeRole</key>
      <string>Viewer</string>
      <key>LSIsAppleDefaultForType</key>
      <true/>
      <key>LSItemContentTypes</key>
      <array>
        <string>public.data</string>
      </array>
      <key>NSDocumentClass</key>
      <string>Document</string>
      </dict>
    (...)

    Johan Kool

    ---
      http://www.johankool.nl/
  • It's done with Apple Events (GURL GURL).
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today