Le 08/06/2014 à 14:36, Shane Stanley < email@hidden> a écrit : On 8 Jun 2014, at 10:30 pm, S. J. Cunningham <email@hidden> wrote:
What process name do you see in Activity Monitor?
"Idle App" of course :)
OK, we covered this in a thread here last week or so. One option was:
tell application "System Events" to set pid to unix id of process "Idle App" do shell script "kill " & pid
But killall should work with the app name.
-- Shane Stanley <email@hidden> <www.macosxautomation.com/applescript/apps/>
Hello Shane It's not what I get.
With the application "taratata.app" running, I ran this script :
set theProcess to "taratata" tell application "System Events" set processNames to name of every process
end tell if result contains theProcess then try do shell script "killall " & theProcess on error tell application "System Events" set pid to unix id of process theProcess end tell do shell script "kill " & pid end try end if
tell application "System Events" get name of every process --> {"loginwindow", "AppleScript Editor", "SystemUIServer", …"Activity Monitor", "taratata", "System Events", "com.apple.WebKit.WebContent"} end tell tell current application do shell script "killall taratata" --> error "No matching processes belonging to you were found" number 1 end tell tell application "System Events" get unix id of process "taratata" --> 2575 end tell tell current application do shell script "kill 2575" --> "" end tell
As you see, the killal command failed and the process was killed thru its pid.
Yvan KOENIG (VALLAURIS, France) dimanche 8 juin 2014 15:01:33
|