Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

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.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.