使用RCP打开OSX中的现有文件并注册文件类型

dut*_*utt 6 macos eclipse-rcp info.plist

我正在安装一个用Java/Ecipse RCP编写的工具的安装程序,除了我认为可能相关的两件事之外,一切正常:

1)打开现有文件.出于某种原因,OSX不会像Windows和Linux那样提供所选文件作为参数.我如何让osx作为参数传递路径?还是有另一种方式?

2)文件类型未正确注册.双击带有扩展名的现有文件会按预期打开应用程序,但是当我"打开" - "其他"时,该工具显示为灰色,如何让osx了解该工具可以打开这些文件?

这是当前的Info.plist:

<?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>CFBundleIconFile</key>
    <string>images/icons/macos.icns</string>
    <key>NSHumanReadableCopyright</key>
    <string>2016 Company</string>
    <key>CFBundleGetInfoString</key>
    <string>Tool description</string>
    <key>CFBundleShortVersionString</key>
    <string>1.2.0</string>
    <key>CFBundleVersion</key>
    <string>1.2.0</string>
    <key>CFBundleDisplayName</key>
    <string>Tool</string>
    <key>CFBundleName</key>
    <string>com.company.tool</string>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.utilities</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleExecutable</key>
    <string>tool</string>
    <key>CFBundleIdentifier</key>
    <string>com.company.tool</string>
    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIdentifier</key>
            <string>com.company.tool.extension</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <string>ext</string>
            </dict>
            <key>UTTypeIconFile</key>
            <string>images/icons/macos.icns</string>
            <key>UTTypeDescription</key>
            <string>tool file</string>
        </dict>
    </array>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <string>images/icons/macos.icns</string>
            <key>CFBundleTypeName</key>
            <string>tool file</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.company.tool.extension</string>
            </array>
        </dict>
    </array>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)