找到了解決方案:啓動AppleScript編輯器工具。編寫一些代碼來啓動終端並從那裏運行腳本。
或粘貼此在那裏:
on open (documentsToOpen)
openInXcode(documentsToOpen)
end open
to openInXcode(documentsToOpen)
tell application "Terminal"
repeat with theDocument in documentsToOpen
set theDocumentName to POSIX path of theDocument
set theScript to "echo " & theDocumentName
do script theScript
set theScript to "open -a Xcode " & theDocumentName
do script theScript
end repeat
end tell
end openInXcode
開業Xcode是一種多餘的,但它只是你可能想在一個shell腳本做一個例子。另存爲應用程序。
這有一個缺點,因爲它寫道:一個新的終端窗口被留下(除非你繼續運行腳本'永遠',當然)。
而且,似乎還必須挖掘出的Info.plist並添加獨特的「捆綁標識符」由AppleScript的工具保存的應用程序,從而使LaunchServices的plist可以用這個應用程序的文件關聯。
將發佈一個解決方案,我儘快做好了,因爲代表性低,時間大約2小時。 OTOH似乎沒有其他回答者,但仍然如此。 – 2012-03-07 20:43:35