Find posts Find posts

I looked through the docs to find out how to allow a drop on the dock icon. From what I saw, it is recommended to use LSItemContentTypes, since CFBundleTypeOSTypes is deprecated. However, I cannot get LSItemContentTypes to work, only with CFBundleTypeOSTypes, which will be **, it will accept drops.

How can I do this in a non-obsolete way?

Thanks Nick

+4
source share
1 answer

Here is what I used in my Info.plist application to make it work:

<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>SomeName</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSHandlerRank</key> <string>None</string> <key>LSItemContentTypes</key> <array> <string>public.mp3</string> </array> </dict> </array> 

Check out Documentation to see what each key does.

CFBundleTypeName and CFBundleTypeRole .

LSItemContentTypes is an array of UTIs . To get a UTI file, simply enter it in Terminal:

 mdls -name kMDItemContentType /path/to/file 

Remember to configure CFBundleTypeRole and LSHandlerRank to meet your needs.

+6
source

Source: https://habr.com/ru/post/1334796/


All Articles