Current glyph window size and position

RoboFont Forums Help / General Current glyph window size and position

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  frederik 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6126

    bahman
    Participant

    Hello,

    I want to make my script window appear in the center of the current active window. I searched in the docs but didn’t found anything useful. Is there any way to do this?

    Best,
    Bahman

    #6128

    frederik
    Keymaster

    He

    I don’t fully understand why but here is a script that is changing the size and position of the current window to the pervious current window

    from AppKit import NSApp
    # get all ordered windows
    windows = NSApp().orderedWindows()
    # get the size of the window
    (x, y), (w, h) =  windows[1].frame()
    # set the size of the window
    windows[0].setFrame_display_animate_(((x, y), (w, h)), True, False)
    

    good luck!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.