OSX Custom extension icon Association
I'm trying to get my application to display an icon for a custom file extension using the following code:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>My Custom Extension</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.myext</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>NSExportableTypes</key>
<array>
<string>com.myapp.myext</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIconFile</key>
<string>Myicon.icns</string>
<key>UTTypeDescription</key>
<string>My Custom Extension</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.myapp.myext</string>
<key>UTType开发者_C百科ReferenceURL</key>
<string>http://www.myapp.com</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>myext</string>
</array>
</dict>
</dict>
</array>
I've tried using both UTTypeIconFile AND CFBundleTypeIconFile, and the icon is present under my Content/Resources folder inside the app bundle, but I still see a blank icon when looking at files that have my file extension
I'm not sure if it matters, but this application is launched using the JavaApplicationStub (it's a java app)
Any help would be appreciated :)
I read about some problems by using just the JavaApplicationStub. Did you try to build an .app
with Apple's Jar Bundler? You should be able to Registering the File Types Your App Supports.
精彩评论