Re: How to find out if an application is running

2005-10-14 Thread Dominic Dunlop
On 2005–10–13, at 19:36, Ted Zeng wrote: As it turns out, only Sherm's version works For all the situations. Great! Go for it. The tough bit about there being more than one way to do it is to resist the temptation to try them all, even after you've found one that works. I can't always

Re: How to find out if an application is running

2005-10-14 Thread Peter N Lewis
At 20:02 -0700 13/10/05, Ted Zeng wrote: Here is the fun part: I made a killapp.pl script and Call it to kill Bridge with `killapp.pl Bridge ` And it kills itself. As it turned out, the script finds itself from the list because the Command line includes Bridge(or Adobe Illustrator for

ruminations on 'ps' commands

2005-10-14 Thread Jeremy Mates
* Peter N Lewis [EMAIL PROTECTED] ps auxw | grep inevitably finds the search command unless you use a trick like the above, or: ps auxw | grep | grep -v grep Or, utterly off topic, the clever regex method, which may run afoul of quoting rules in certain shells, but is quicker

Re: How to find out if an application is running

2005-10-14 Thread Ted Zeng
I like these solution. Thanks. ted On 10/13/05 10:59 PM, Peter N Lewis [EMAIL PROTECTED] wrote: At 20:02 -0700 13/10/05, Ted Zeng wrote: Here is the fun part: I made a killapp.pl script and Call it to kill Bridge with `killapp.pl Bridge ` And it kills itself. As it turned out, the

Re: How to find out if an application is running

2005-10-14 Thread Chris Nandor
I just uploaded Mac::Apps::Launch. Now IsRunning() returns the PSN, instead of simple true/false (1/0). Here's a fun, simple, and efficient script to kill the Dock (which should relaunch immediately): use Mac::Apps::Launch 1.92; use Mac::Processes; use POSIX 'SIGTERM'; my $psn =