On Sep 5, 2012, at 11:48 AM, koenig.yvan wrote: I just need to use killal aProcess as a substitute to tell application anApp to quit
because processes names aren't always matching applications ones. For instance, the process for « openOffice » is « soffice »
I just experimented with that and got some failures, but then this worked ...
tell application "System Events" unix id of application processes whose visible is true --> {133, 208, 212, 247, 255, 259, 267} name of application processes whose visible is true --> {"Finder", "M_a_i_l_Monitor", "DragThing", "Smile", "Activity Monitor", "HardwareMonitor", "Mail"} end tell
do shell script "kill 267" -- this kills Mail
The 'kill' command takes only the unix id, shown in Activity Monitor as 'PID'. The two lists seem to be synchronized, so you can easily convert the name to its PID.
|