Voici l'AppleScript que j'utilise. .
tell application "System Events"
set listOfProcesses to (name of every process where background only is false)
tell me to set selectedProcesses to choose from list listOfProcesses with multiple selections allowed
set myResult to ""
end tell
--The variable selectedProcesses will contain the list of selected items.
repeat with processName in selectedProcesses
do shell script "Killall " & quoted form of processName
end repeat
repeat with s in every string in selectedProcesses
set myResult to myResult & " ," & s
end repeat
tell application "Finder" to display notification "Apps closed successfully:
" & selectedProcesses
Veuillez m'indiquer un moyen de séparer les résultats dans displayNotification par une coma. Dans ce cas, les deux applications sont Notes et Reminder. . La notification ressemble à ceci-