How to get window size?

You want the position of the SketchUp main window? Or the viewport?

Those are values we don’t have exposed via the API.

We currently only expose size and position of the HtmlDialog itself. This was added in SU2021.1 that was released yesterday:

Can you elaborate on what you’re doing that require you to position the HtmlDialog in relationship to the SU window or Viewport? Also whether it’s SU’s main window or Viewport is also important info to know, as on macOS SU is an MDI, so you’d have multiple windows. Or even none if all models are closed.