I need to add a context menu item in the Finder application for a custom file type. So I created the service using Apple Automator. When I specify for public.data in NSSendFileTypes, the context menu item is usually displayed in all file types, but when I use the UTI specified in my info.plist application, it does not work in certain custom file types. Can someone help to hint, is it possible to use custom UTI filtering for the Finder context menu service at all and if so, what am I doing wrong or maybe some kind of “know how”?
Here is my info.plist file of the service workflow file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>MyService</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
<key>NSRequiredContext</key>
<dict>
<key>NSApplicationIdentifier</key>
<string>com.apple.finder</string>
</dict>
<key>NSSendFileTypes</key>
<array>
<string>com.myapp.anytype</string>
</array>
</dict>
</array>
</dict>
</plist>
Here is the UTI declaration code from my info.plist application.
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.archive</string>
</array>
<key>UTTypeDescription</key>
<string>Any type file format</string>
<key>UTTypeIdentifier</key>
<string>com.myapp.anytype</string>
<key>UTTypeReferenceURL</key>
<string>http://myapp.com</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>anytype</string>
</array>
</dict>
</dict>
</array>
, , .