Just wondering if there is a way to retrieve open windows and minimize them from the command line in Lion?
I have an AppleScript that does this, but it kind of slow, so wanted to know if there was anything
EDIT: I have not completely figured out how to do it yet, but there is the command line command osascript which allows you run applescript from the command line. So you can use:
osascript -e "applescript command goes here"
SOLVED: Yes you can do it... here is how I figured it out:
/usr/bin/osascript -e 'tell application "System Events" to click (first button of (every window of (application process "firefox")) whose role description is "minimize button")'
Some other application process that I have are "Skype", "Finder", "thunderbird-bin", AppleScript Editor"