Tag: activity monitor

AppleScript强制退出Java(JAR)程序?

你好, 我在MAC OS上运行Java(jar)应用程序。 我正在使用AppleScript来运行Java程序,它运行正常。 现在,我喜欢使用AppleScript来关闭Java程序。 我需要强制退出 Java程序。 我使用了以下AppleScript, set app_name to “NPC” set the_pid to (do shell script “ps ax | grep ” & (quoted form of app_name) & ” | grep -v grep | awk ‘{print $1}'”) if the_pid is not “” then do shell script (“kill -9 ” & the_pid) 运行Java程序的AppleScript称为“NPC.app”。当我运行“NPC.app”时,它在Activity Monitor应用程序上显示为NPC和NPC.npc 。 […]