tell application "Safari"
set allWindows to get windows
set n to count allWindows
repeat until n = 0
set miniaturized of window n to true
set n to n - 1
end repeat
end tell
tell application "Safari"
set allWindows to get windows
set n to count allWindows
repeat until n = 0
set miniaturized of window n to true
set n to n - 1
end repeat
end tell