Mot
Mot

Reputation: 29570

OS X: shell script within .app bundle should accept dropped files or directories

I'm using a shell script to launch my (Java) application wrapped in a .app bundle. When I try to drop file or directories onto the application icon of the not running application in the Finder, they will be copied in this directory instead of launching the application with these as command line parameters.

Do I have to add some "magic" entries to the Info.plist?

Upvotes: 2

Views: 621

Answers (1)

Dmitriy Kutskov
Dmitriy Kutskov

Reputation: 21

I've get app accepting droped files (.MOVs), but I can't get filename as argument to my script... ((

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

ffmpeg is a simple script that begins with #!/bin/sh

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>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>

I don't know any about CFBundleTypeRole, but my ffmpeg.app accept droped .MOVs

Upvotes: 2

Related Questions