First up, I'm not sure of terminology so when I refer to "action"
below, I mean the things that will get done with whatever file. In
other words I bring up quicksilver, type the name of the script, then
hit tab....the list that I get here is what i'm referring to as
"action" below.


Ok guys, I use a bit of shell scripting, and I'd like to be able to
run these scripts by calling them in quicksilver.
I've modified my shell scripts to have a .command extension, which
lets OSX know to open them in a terminal window. For example I have
the file pinger.command, which when double clicked in the Finder,
opens up a new terminal window and executes the script. Works like a
charm.

Now when it comes to Quicksilver, it finds these files and if I change
the action from the default of "run" to "open" then they open with
terminal, just like if I double clicked them in the Finder.....so far
so good!
Of Note here is that the "open" command, when called via double click
in Finder OR when called via Quicksilver, appends a "; exit" to the
command when it inputs it in the terminal, so that when the script
finishes the shell is exited in the terminal window....I like this a
lot.

Now if I use the Terminal plug-in, I get another option in Quicksilver
(besides  "run" and "open") for .command files, "Run in Terminal"
which is SUPER cool because it puts a text box below the action which
lets me pass parameters to the script!!!! This also functions similar
to the "open" command in that it spawns a new terminal window and runs
the script. Unfortunately, unlike "open" it doesn't append "; exit",
so when the script exits i've got a live shell running.....but I can
deal with that.

The real PROBLEM, is that "run" is the default action for .command
files, and apparently this command tries to run the scripts as some
sort of hidden process. This is perfectly fine for scripts which
require no user input, but for the scripts that DO require user input
it can cause Quicksilver to become unresponsive while the script is
running.

The example is a script that I have that loops until the user presses
a key. Now when I use the "open" or "run in terminal" action, these
spawn new terminal windows which allow me to press a key, thus ending
the loop.
However, when I use the "run" action, there is no way to press a key,
so the loop goes on forever, and quicksilver stays busy with the
script so I can no longer use it!!!



Naturally, I'd rather avoid EVER using the plain "run" action, but it
is the default action.

ACTUAL QUESTION: How do I change the default action for these file
types? (I'd like to change the action for .command as well as .sh
files)

Thanks in advance

Reply via email to