2012-12-27 55 views
1

我已經寫了一個簡單的命令行可執行文件,並試圖在打開其封閉文件夾時啓動該文件。我正在使用打開AppleScript的文件夾操作。到目前爲止,AppleScript的是:如何在不打開終端的情況下啓動可執行文件?

tell application "Finder" 
     open document file "Feed the Beast Launcher" of folder "Feed The Beast" of folder "Desktop" of folder "Matthew" of folder "Users" of startup disk 
    end tell 

和可執行文件是:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home 
    java -jar ~/Desktop/Feed\ The\ Beast/FTB_Launcher.jar 

你能幫忙嗎?

回答

0

使用罐Bundler.app創建您的jar文件的一個獨立的應用程序,並使用類似

tell application "FTB_Launcher.app" to activate 

啓動應用程序。

+0

工作很好!謝謝! –

相關問題