How to loop thru all open windows for an app?

Hey Michael,

Yes, it can be done.

Stickies is not scriptable, but AppleScript can see it via UI-Scripting.

tell application "System Events"
   tell application process "Stickies"
      tell window 1
         set position to {0, 22}
         set size to {400, 300}
      end tell
   end tell
end tell

Keyboard Maestro can also see Stickies' windows:

Resize the Front Window.kmmacros (2.4 KB)

Here's the basics of how to iterate through the windows:

Keyboard Maestro 8.2d1 “Stickies ⇢ Resize Windows” Macro

Stickies ⇢ Resize Windows.kmmacros (5.7 KB)

You can change the resize fields to variables by inserting a variable name.

You'll have to manage the position of the windows as well.

There are a bunch of window management macros on the forum you can look at to get ideas on how to do all of this.

But don't bang your head against the wall for more than an hour at a time – if you get stuck ask for help.

-Chris