2009-12-16 75 views
2

我试图编写一个applescript,它将运行放在我的网络上的特定文件夹上的任何shell脚本。获取文件夹操作以运行shell脚本

我一直在试图用:

on adding folder items to target_folder after receiving this_script 
    tell application "Terminal" to open this_script 
end adding folder items to 

但我没有任何运气。

关于什么可能是错误的任何想法?

+0

确保shell脚本的名称扩展名为.command。否则他们不会打开。 – fireshadow52 2011-08-05 17:42:26

回答

0

未经检验的,但尝试:

on adding folder items to target_folder after receiving added_items do shell script " " end adding folder items to

参见如何格式化你的shell脚本Technical Note TN2065: do shell script in AppleScript

+0

这似乎没有工作。输入终端时脚本运行良好。我认为它可能不得不做一些脚本不可执行的东西。当我首先对它运行chmod + x时,结果会更好。我只是不知道如何编写用于执行该操作的语法,然后运行该脚本。 – 2009-12-16 20:40:20

+0

编辑上面的问题并添加您的shell脚本,以便人们可以看到它。 – markratledge 2009-12-16 21:30:37

0

我会下注现金,这是因为您的某些角色需要在shell脚本中转​​义。发布您的脚本。