use scripting additions
use framework "AppKit"
my forceQuitApplication("SystemUIServer")
on forceQuitApplication(anApplication)
--require Framework: AppKit
tell application "System Events"
set bundleIdentifier to bundle identifier of my getProcess(anApplication)
end tell
return (current application's NSRunningApplication's runningApplicationsWithBundleIdentifier:bundleIdentifier)'s forceTerminate as boolean
end forceQuitApplication
on getProcess(args)
tell application "System Events"
if class of args = application then
return application process (name of args)
else if class of args = application process then
return args
else
return application process (args as text)
end if
end tell
end getProcess