1

This is the AppleScript I am using..

    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

enter image description here

Please tell me a way to separate to results in displayNotification by a coma. In this case, the two apps are Notes and Reminder.. The Notification looks like this- enter image description here

  • 1
    Apps closed... " & myResult - though it would be simpler to answer had you posted the actual script rather than a picture of it; I'm not going to type it all out to test I'm right :P – Tetsujin Dec 7 '17 at 13:43
  • Yes...! It worked. Thanks for the help. @Tetsujin Also, now I have inserted the exact code in my question. – TUSHAR TUSHAR Dec 7 '17 at 14:25
1

Just need to replace selectedProcesses with myResult

tell application "Finder" to display notification "Apps closed successfully: " & selectedProcesses

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .