Code for minimizing application window in Mac?

Vivek Subramanian picture Vivek Subramanian · Aug 25, 2010 · Viewed 10.6k times · Source

I'm wondering whether there is a way to write code for Mac OS 10.5 which will minimize and restore a window. What language would it be in? Could someone please give me an example or direct me to documentation on Apple's developer site I should look at?

Thanks!

Answer

Kitto picture Kitto · Aug 25, 2010

Try this applescript:

tell application "Safari"
  set miniaturized of window 1 to true
end tell