Skip to content

Instantly share code, notes, and snippets.

@badcharan
Created February 4, 2016 02:40
Quit user choiced applications.
tell application id "com.apple.SystemEvents"
-- バックグラウンドアプリケーション以外の名前を取得
set appList to name of application processes whose visible is true
end tell
tell application (path to frontmost application as text)
activate
-- 終了するアプリケーションを選択
-- 最初は全アプリケーションを選択
set selectedApps to choose from list appList default items appList with prompt "終了するアプリケーションを選択(複数可):" with title "アプリケーションリスト" with multiple selections allowed
-- キャンセルされたら終了
if selectedApps is false then return
end tell
-- 選択されたアプリケーションを終了する
repeat with thisApp in selectedApps
try
tell application thisApp to quit
end try
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment