Anyhow, I was able to figure out that if I changed the extension
to .command, then I could double click from the desktop... or
wherever.
The .command works perfect, it launches a terminal and executes the
script (this is necessary because some of the scripts require input).
My new pet peeve is that the terminal remains open! I tired putting a
simple exit command, no dice... the terminal just says [logout]
process completed. Some quick searches as not given me much insight.
So, how can I go about closing the terminal after the script is
complete..? Or I should say, what do I need to add to the end of my
script to close the terminal?
Thanks in advance,
Scott
kill -3 $(ps wax | grep "[T]erminal.app" | awk '{print $1}')
Its a bit brute, but it works.
SA
If you plan on distributing these things, could you tell me where they can
be found and what they're called so I can make sure I never, ever end up
using them by mistake?
--
Michael Ash
Rogue Amoeba Software
Thus trashing any other terminals the user happens to have open,
completely unconnected with your app.
I'd call that buggy.
--
Tony
You might be able to use AppleScript (through the osascript command) and
'tell window 0 of application 'Terminal' to close' (or someting similar
that actually works).
patrick
> I agree it's nasty... but how do you go about closing that specific terminal.
Instead of using a .command file, use a .term file. The way you make one of
those is so open a new window in Terminal, set its settings the way you want
them, then use File > Save. All the window settings get saved, and you get to
specify which command is to be run when the file is loaded.
hth
Ben
--
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>
-- AppleScript wrapper to execute UNIX shell scripts
-- with a drag and drop interface.
-- Found basic script at http://MacOSXHints.com
-- cmdenv is a program I originally wrote back in
-- 1985 to help me see what a fork/exec'ed program
-- was seeing. I find it highly useful.
-- Bob Harris 4-Jun-2005
on open filelist
repeat with i in filelist
-- do shell script "my_command " & quoted form of POSIX path of i
do shell script "yourScriptHere >/dev/null " & quoted form of
POSIX path of i
end repeat
end open
-- NOTE: the do shell line may be line warpped.
-- It is suppose be one line ending in "... POSIX path of i"
-- so if it has been lined wrapped put it back together again
-- Use the Applications -> AppleScript -> Script Editor
-- to create an executable AppleScript from the above.
Bob Harris