AppleScript "window size" attribute?

Discussion in 'Mac Programming' started by DanTekGeek, Jul 12, 2005.

  1. DanTekGeek macrumors 6502

    Nov 11, 2004
    Denver, CO
    I'm trying to hack together an applescript that will resize a window on my main display, and move the window to a set position on another display. I have been trying to work with the "bounds" attribute, but the window won't seem to go to the right size. Essentially what I need to do is find if there is an attribute for the dimensions of a window. "bounds" seems to be tied to where the window is compared to the edge of the screen.

    Essentially, I want to do this:

    Get the size of window x

    Make window y the size of window x

    Move window x to position z on display b

    Move window y to position w on display b

    thanks in advance for your help.
  2. HiRez macrumors 603


    Jan 6, 2004
    Western US
    I don't know anything about AppleScript, but in Cocoa, "frame" is what defines the basic origin and size of a window, "bounds" defines the position and size relative to an enclosing container. Maybe it's the same in AppleScript?
  3. robbieduncan Moderator emeritus


    Jul 24, 2002
    It bounds for size (which makes sense even in Cocoa frame has origin (for the x/y position) and bounds for the size).

    I covered this here

Share This Page