yuktikapahwa

Q: Exported UTI file extension Info.plist

 

up vote0down votefavorite

 

 

I have gone through many links for this problem and there is lot of information available on the same .But my requirement is a bit different . I want to assign an icon to my file with a different extension .So following are my extensions rtf.qi(rtf.icns) , pdf.qi (pdf.icns) , docx.qi(docx.icns) , txt.qi(txt.icns) , file.qi(file.icns) and anything else except the above but ending with qi (A.icns).When I add the following DocumentTypes in my plist AS BELOW :

  <key>CFBundleDocumentTypes</key>
<array>
<dict>
  <key>CFBundleTypeIconFile</key>
  <string>txt.icns</string>
  <key>CFBundleTypeName</key>
  <string>Txt QI Source</string>

  <key>CFBundleTypeRole</key>
  <string>Viewer</string>
  <key>LSHandlerRank</key>
  <string>Owner</string>
  <key>LSItemContentTypes</key>
  <array>
  <string>com.apple.txt.qi</string>
  </array>
</dict>
<dict>
  <key>CFBundleTypeIconFile</key>
  <string>A.icns</string>
  <key>CFBundleTypeName</key>
  <string>A QI Source</string>

  <key>CFBundleTypeRole</key>
  <string>Viewer</string>
  <key>LSHandlerRank</key>
  <string>Owner</string>
  <key>LSItemContentTypes</key>
  <array>
  <string>com.apple.a.qi</string>
  </array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
  <key>UTTypeConformsTo</key>
  <array>
  <string>public.data</string>
  </array>
  <key>UTTypeDescription</key>
  <string>Txt QI Source</string>
  <key>UTTypeIdentifier</key>
  <string>com.apple.txt.qi</string>
  <key>UTTypeTagSpecification</key>
  <dict>
  <key>public.filename-extension</key>
  <array>
  <string>txt.qi</string>
  </array>
  </dict>
</dict>
<dict>
  <key>UTTypeConformsTo</key>
  <array>
  <string>public.data</string>
  </array>
  <key>UTTypeDescription</key>
  <string>A QI Source</string>
  <key>UTTypeIdentifier</key>
  <string>com.apple.a.qi</string>
  <key>UTTypeTagSpecification</key>
  <dict>
  <key>public.filename-extension</key>
  <array>
  <string>qi</string>
  </array>
  </dict>
  </dict>
  </array>

 

As it can be seen above I have added two types of extensions for instance : qi and txt.qi But when i run my application , it assigns A.icns to all my files with qi extensions irrespective of txt qi or pdf qi . It just looks for an end with qi and it takes that icon. Whereas I want a separate icon for txt.qi and pdf.qi but somehow plist is not intelligent enough to understand the dots specified in the extensions. Can anyone please tell me how to customise that.

Mac Pro, Mac OS X (10.7.5)

Posted on Jun 9, 2016 8:26 AM