This code decreases run time of the previous code by at least 90%. It's a huge improvement.
on run
tell application "System Events"
set foregroundApps to (every process whose background only is false) as list
repeat with foregroundApp in foregroundApps
set appName to name of foregroundApp
if exists (window 1 of process appName) then
if contents of appName is not "" then
repeat with w in every window of foregroundApp
if value of attribute "AXMinimized" of w is true then
set value of attribute "AXMinimized" of w to false
end if
end repeat
end if
end if
end repeat
end tell
end run
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: