Watson1978
10/8/2011 - 8:43 AM

MacRuby : terminate the running applications

MacRuby : terminate the running applications

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