2012-04-20 16 views
1

我正在使用shell腳本來啓動包裝在.app包中的我的(Java)應用程序。當我嘗試將文件或目錄放到Finder中未運行的應用程序的應用程序圖標上時,它們將被複制到此目錄中,而不是將這些應用程序作爲命令行參數啓動。OS X:.app包中的shell腳本應該接受被刪除的文件或目錄

我是否需要在Info.plist中添加一些「魔術」條目?

回答

1

我已經得到應用則接受DROP掉的文件(.MOVs),但我不能讓文件名作爲參數傳遞給我的腳本...((

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

的ffmpeg是一個簡單的腳本與#!/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> 

我不知道任何有關CFBundleTypeRole,但我ffmpeg.app接受DROP掉.MOVs

相關問題