MacOS – Adding application to “Open With” context menu – QNapi problem

applicationsfindermacos

I have tried many available solutions (searched through similar questions), most of them was quite obvious – like editing Info.plist in the application package, but oryginal application Info.plist data seems to look fine (it has correct file type definitions):

<?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>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>rm</string>
                <string>mpg</string>
                <string>mpeg</string>
                <string>mov</string>
                <string>avi</string>
                <string>rmvb</string>
                <string>mkv</string>
                <string>m4v</string>
                <string>mp4</string>
                <string>asf</string>
                <string>divx</string>
                <string>ogm</string>
                <string>wmv</string>
            </array>
            <key>CFBundleTypeIconFile</key>
            <string>qnapi.icns</string>
            <key>CFBundleTypeRole</key>
            <string>None</string>
            <key>LSUIElement</key>
            <false/>
        </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>QNapi</string>
    <key>CFBundleGetInfoString</key>
    <string>Created by Qt/QMake</string>
    <key>CFBundleIconFile</key>
    <string>qnapi.icns</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>ttxt</string>
    <key>LSUIElement</key>
    <true/>
</dict>
</plist>

Whatever I do, I can't force OS X to show this application in "Open With" context menu after right clicking on a supported file.

I have also tried to reset settings with:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

but it didn't work.

Updating, removing and reinstalling etc didn't help either. Above is original application plist that works well on other Mac. It seems like only on my OS X it doesn't work.

Do you have any idea what else could I do to make this application available in the "Open With" context menu (the problem is QNapi related only)?

Best Answer

I got QNapi to show up in the open with menu by changing

<key>CFBundleTypeRole</key>
<string>None</string>

to

<key>CFBundleTypeRole</key>
<string>Viewer</string>

and then running /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/QNapi.app and quitting and reopening Finder.

(lsregister -f forces a file to be registered even if its modification date has not changed.)