Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Rhino/JavaScriptをMacアプリに仕上げる方法 ref:
on main(input)
-- スクリプトの名前
set mainScript to ""
-- 親ディレクトリの取得
tell application "Finder" to set parentDirPos to parent of (path to me) as text
set parentDir to ((alias parentDirPos)'s POSIX path)
do shell script "cd " & parentDir & ";./" & mainScript & space & input
end try
end main
on open argv
repeat with aFile in argv
main(quoted form of POSIX path of aFile)
end repeat
end open
on run
-- ファイル選択を行う場合
-- main(quoted form of POSIX path of (choose file))
-- 引数をつけない場合
end run
#!/usr/bin/java -Dfile.encoding=UTF-8 -cp ./js.jar
// ここに Rhino/JavaScriptのコードを記述
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment