Is there a better way to minimize all windows than the front Finder or Safari window than this?
tell application "Finder"
repeat 30 times
tell window 2
set collapsed to true
end tell
end repeat
end tell
tell application "Safari"
repeat 30 times
tell window 2
set miniaturized to true --hide
end tell
end repeat
end tell
I know the syntax is wrong but I was thinking something like the following based on http://developer.apple.com/library/mac/#documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_reference_forms.html
tell application "Finder"
set miniaturized to true for every window whose name is not "Window 1"
end tell
or even close every other window but window 1
tell application "Finder"
close (every window whose name is not "Window 1")
end tell
Sorry to bother I have spent the day on this and can’t figure it out. I have looked all over AppleScript 1-2-3 and this forum but I am not sure what to even search anymore. It’s painful being such a noob.
I did learn from the book the reason “collapsed” is used is a hold over from OS 9 feature and why they use it instead of “miniaturized”. Why the term minimized wasn’t chosen sure leaves me to wonder, I guess it sounded too much like MS Windows, but I digress.