osx - AppleScript to force quit Java (JAR) programs? -
hello,
i run java (jar) application on mac os. using applescript run java program , works fine. now, use applescript close java program. need force quit java program. used following applescript,
set app_name "npc" set the_pid (do shell script "ps ax | grep " & (quoted form of app_name) & " | grep -v grep | awk '{print $1}'") if the_pid not "" shell script ("kill -9 " & the_pid)
the applescript runs java program called "npc.app" when run "npc.app" shows npc , npc.npc on activity monitor application. above code set remove npc application not remove either npc (this "npc.app") or npc.npc (this java program). following error,
error "sh: line 0: kill: 1180 1182: arguments must process or job ids" number 1
1180 being pid npc , 1182 being pid npc.npc in activity monitor.
what correct applescript force quit java program?
Comments
Post a Comment