Try "Quit All" written by Satoshi Matsumoto. Good luck.
http://www.matsumoto.co.jp
property theAppList : {}
property theTimeout : 3
tell application "Finder"
copy (count of process) to maxNum
set theAppList to {}
repeat with num from 1 to maxNum
copy file type of process num to theType
if theType is "APPL" then
if process num is not frontmost then
copy name of process num to theApp
copy theAppList & theApp to theAppList
end if
end if
end repeat
end tell
copy the (length of theAppList) to maxNum
repeat with num from 1 to maxNum
copy item num of theAppList to theApp
tell application "Finder"
copy visible of process theApp to theStat
if theStat is false then
try
set visible of process theApp to true
end try
copy visible of process theApp to theStat
end if
end tell
if theStat is true then
tell application "Finder" to set frontmost of process theApp to true
try
with timeout of theTimeout seconds
tell application theApp to quit
end timeout
end try
end if
end repeat