Created
October 8, 2011 08:43
-
-
Save Watson1978/1272037 to your computer and use it in GitHub Desktop.
MacRuby : terminate the running applications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework 'AppKit' | |
IGNORE = { | |
'com.apple.finder' => true, | |
'com.apple.Terminal' => true, | |
} | |
apps = NSWorkspace.sharedWorkspace.runningApplications | |
apps.each do |app| | |
if app.activationPolicy == NSApplicationActivationPolicyRegular | |
app.terminate unless IGNORE[app.bundleIdentifier] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment