Hi. I'd like to see a command that could move a window relative to the display size. That is, if I want to move a window to the center of my display, the command might look like:
win << Move Window Relative(0.5, 0.5)
If the user has multiple displays, the command would assume the current display is being used.
Currently, if I want my script to center a window:
1. Create a dummy window that is assumed to be larger than any display (10k x 10k).
2. Get the resulting window's actual size. This is assumed to be the size of the user's display.
3. Close this window.
4. Now create the intended window and get its size.
5. Compute the desired new window upper-left corner coordinates using the display size and window size.
6. Move the new window using the << Move Window command.
I find that it helps to improve the users' experiences with the tools I'm developing if my windows always appear in the same place when they use it, rather than changing locations each time. Not being able to predict the users' display sizes necessitates the steps above however.