2011-02-19 193 views
9

我知道有一个终端插件为quicksilver,但我会调用终端命令,基本上只是在后台运行,永远不会弹出一个终端窗口。那可能吗?从quicksilver运行终端命令

UPDATE:

我在我的AppleScript,但它给我的错误以下代码:

do shell script "/path/to/shell.sh blah" 

错误:

curses.setupterm() 
_curses.error: setupterm: could not find terminfo database 

回答

1

AppleScript的是简单的解决方案,请参阅: http://developer.apple.com/library/mac/#technotes/tn2002/tn2065.html

样品:

do shell script "ifconfig" 
do shell script "ifconfig" user name "Anne" password "[email protected]" with administrator privileges 

Automator也可以在后台运行shell脚本。

如果您熟悉XCode,可以在Objective-C中使用NSTask。

+0

我有一个shell脚本,我可以从终端运行,它工作正常,但是当我尝试运行相同的命令与执行shell脚本“/path/to/shell.sh等等”它给了我下面的错误` curses.setupterm() _curses.error:setupterm:找不到terminfo数据库' – user140736 2011-02-19 02:34:22

1

等一下,你的shell脚本是bash shell脚本吗?在你的第一行你有:

#!/bin/bash 

如果没有,将该行添加到您的脚本。 另外,而不只是

do shell script "/path/to/yourscript.sh" 

考虑这个问题:

do shell script "/bin/bash /path/to/yourscript.sh" 
+0

它不是一个漫长的运行过程。我基本上有一个cli todo脚本,我想用quicksilver快速添加我的todo物品。 – user140736 2011-02-19 02:57:48

5

在水银可以使用行动“运行命令壳牌”,这是“终端模块”的一部分。该命令运行时不显示窗口。搜索引用的条款,你会发现一些例子。