bundle中的OS X:shell脚本.app应该接受丢弃的文件或目录



我正在使用shell脚本来启动包装在.app捆绑包中的(Java)应用程序。当我尝试将文件或目录拖放到 Finder 中未运行的应用程序的应用程序图标上时,它们将被复制到此目录中,而不是使用这些作为命令行参数启动应用程序。

我必须向Info.plist添加一些"魔法"条目吗?

我让应用程序接受丢弃的文件(.MOV),但我无法将文件名作为脚本的参数......((

ffmpeg.app/Contents/Info.plist
ffmpeg.app/Contents/MacOS/ffmpeg
ffmpeg.app/Contents/Resources/ffmpeg.icns

FFMPEG 是一个简单的脚本,以 #!/bin/sh 开头

信息列表:

<?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>CFBundleDevelopmentRegion</key>
    <string>Russian</string>
    <key>CFBundleExecutable</key>
    <string>ffmpeg</string>
    <key>CFBundleName</key>
    <string>ffmpeg</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleIconFile</key>
    <string>ffmpeg.icns</string>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>mov</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Converter</string>
            <key>LSTypeIsPackage</key>
            <false/>
        </dict>
    </array>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
</dict>
</plist>

我对CFBundleTypeRole一无所知,但我的 ffmpeg.app 接受掉落。移动视频

最新更新