10

I know there is a Terminal plugin for quicksilver but I would invoke terminal commands which basically just runs in the background and never popups a terminal window. is that possible?

UPDATE:

I have the following code in my applescript but its giving me an error:

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

error:

curses.setupterm()
_curses.error: setupterm: could not find terminfo database
user140736
  • 1,913
  • 9
  • 32
  • 53

3 Answers3

7

In Quicksilver you can use the action "Run Command in Shell", which is part of the "Terminal Module". The command is run without showing a window. Search on the quoted terms and you'll find some examples.

slothbear
  • 2,016
  • 3
  • 21
  • 38
2

Applescript is the simple solution, see: http://developer.apple.com/library/mac/#technotes/tn2002/tn2065.html

Sample:

do shell script "ifconfig"
do shell script "ifconfig" user name "Anne" password "p@ssw0rd" with administrator privileges

Automator can also run shell scripts in the background.

If you are familiar with XCode, you can use NSTask with Objective-C.

Anne
  • 26,765
  • 9
  • 65
  • 71
  • I have a shell script which I can run from a terminal and it works fine but when I try to run the same command with do shell script "/path/to/shell.sh blah" it gives me the following error `curses.setupterm() _curses.error: setupterm: could not find terminfo database` – user140736 Feb 19 '11 at 02:34
1

Hold on a sec, is your shell script a bash shell script? In your first line do you have:

#!/bin/bash

If not, add that line to your script. Also instead of just

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

consider this:

do shell script "/bin/bash /path/to/yourscript.sh"
chutsu
  • 13,612
  • 19
  • 65
  • 86
  • its not a long running process. I basically have a cli todo script which I wanna use quicksilver to quickly add my todo items. – user140736 Feb 19 '11 at 02:57
  • can you give us more info on what the todo script does? – chutsu Feb 19 '11 at 12:25
  • all it does is add items to a sqlite database. So I execute a command something like 'todo -a blah' and it adds blah to the list. – user140736 Feb 19 '11 at 13:23