使用applescript运行shell函数

时间:2012-03-24 17:50:57

标签: function shell applescript

我正在潜入github并找到了一个很棒的脚本来创建你的完整默认项目。 http://digitalformula.net/articles/html5-boilerplate-quick-setup-script/

它对我来说就像一个魅力。但我觉得用applecript运行它会很好。 我是Apple的新手,我需要从.sh文件中运行一个函数。 我尝试使用'do shell script'在.sh文件中运行该函数,但它继续从if语句返回echo。

我有一个丑陋的解决方案,如下所示,有效,但有人可以解释为什么'做shell脚本'不适合我。我知道他无法从外部网址找到'哪个git'。

tell application "Terminal"
    do script "cd " & path_name in window 1
    do script "myfunc > /dev/null 2>&1 &" in window 1
end tell

谢谢!

0 个答案:

没有答案
相关问题