I need to set up a routine under OS X that will kill and restart a Macintosh Carbon application that tends to hang. Doing something akin to this in the Terminal:
…doesn’t work because the application is hung.
If I were doing it in person, I could get the PID from “top” and then issue the “kill #” command, but since the PID is going to be different and of unpredictable value, I don’t see any easy way of using that.
Unless there exists an easily accessed routine for obtaining the current PID for an application if you happen to know its name?
Alternatively, is there an osa command that will kill off a hung application, as opposed to telling the application to kindly absent itself?
The application, btw, is FileMaker Pro, and the “hung” condition consists of a modal message box coming up on screen stating that “Communication with the Host has been interrupted and cannot be reestablished” with an “OK” button. (It’s a Jaguar thing. FileMaker is great under 10.1.5, but not so happy with 10.2. Due to middleware I have to run, I’m stuck with 10.2 on this box). Anyway, with that message box up, FileMaker is unresponsive to anything and everything, short of someone reaching over with the mouse and clicking the blasted button.
Hmm, that’s another possibility. Is there an OS X version of “Okey Dokey”, a “pusher of default dialog buttons on unattended computers” kind of utility?