Platypusを使用して、OSX 10.8 でインタラクティブなコマンドライン プログラム用のアプリ ランチャーを作成しようとしています。アプリケーションをダブルクリックして、ターミナル ウィンドウを開いてプログラムを実行できるようにしたいと考えています。問題は、私の Applescript (Octave から借用し、Juliaに適合) がターミナル ウィンドウを起動し、それにいくつかのコマンドを吐き出そうとすることですが~/.bash_profile
、これを妨げるかなりの負荷があります。Applescript でログイン以外のシェルを開く方法や、 source~/.bash_profile
などを開かないようにする方法はありますか?
Platypus が実行するスクリプトは次のとおりです。
# This is the startup procedure written as AppleScript to open a
# Terminal.app (if the Terminal.app is not already running) and start
# the Julia program.
# 20071007 removed: open -a /Applications/Utilities/Terminal.app
osascript 2>&1>/dev/null <<EOF
tell application "System Events" to set ProcessList to get name of every process
tell application "Terminal"
activate
if (ProcessList contains "Terminal") or ((count of every window) is less than 1) then
tell application "System Events" to tell process "Terminal" to keystroke "n" using command down
end if
do script ("exec bash -c \"PATH=${ROOT}/julia/bin:${PATH} OPENBLAS_NUM_THREADS=1 FONTCONFIG_PATH=${ROOT}/julia/etc/fonts GIT_EXEC_PATH=${ROOT}/julia/libexec/git-core GIT_TEMPLATE_DIR=${ROOT}/julia/share/git-core exec '${ROOT}/julia/bin/julia'\"") in front window
end tell
EOF
# Quit the Julia.application immediately after startup (ie. quitting
# it in the taskbar) because once it is started it cannot be restarted
# a second time. If Julia.app stays (eg. because of a crash) opened
# then restarting is not possible.
osascript 2>&1>/dev/null <<EOF
tell application "julia"
quit
end tell
EOF