@OldCoot - The AHK script is below. Take careful note of the comments. A lot of this is hard coded to work with my setup, so you may need to make adjustments. Use at your own risk.
; AlignTrays - Align Trays
; I have to run in administrator mode for this to work with Sketchup 2023
;
; This is set up for 3 monitors.
; My display resolution is 2560x1440
; You may have to adjust defW/defH variables below for your screen
; This script also assumes the center display is the primary monitor,
; with the left monitor having negative coordinates, the center monitor starting at 0, 0,
; and the right monitor starting at the display width coordinate.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
#Singleinstance force
;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;--------------CRITICAL INFO-------------------
;I’m working with the following customized SketchUp trays:
;T1 (SU Tray 1)
;T2 (SU Tray 2)
;T3 (SU Tray 3)
;Model Info (SU model info)
;Profile Dialog (profile builder dialog)
;set AHK definitions
;Use Alt+F9 to align left, Alt+F10 to align center, Alt+F11 to align right
!F9::AlignTrays(1)
!F10::AlignTrays(2)
!F11::AlignTrays(3)
AlignTrays(mon)
{
; Get the system settings for available monitor space
SysGet, m, Monitor, %mon%
defW := 447 ; default width of the trays, adjust as needed to your monitor resolution
defT := 30 ; This can be set to zero, but I need an offset at the top because I have WinStep loaded and it takes up some top space.
defH := 1100 ; default height of trays, adjust to your monitor resolution
if (mon = 1)
{
x1 := (mRight - defW)
}
else
{
x1 := (mLeft)
}
; set the the position of T1, everything else aligns with it.
; the +10 was added here to resize the window to work around a SketchUp bug.
; the next line can be removed once SU fixes the bug
WinMove, T1, %x1%, %defT%, defW+10, 1100 ; remove when bug is fixed
WinMove, T1, %x1%, %defT%, defW, 1100
WinGetPos, x, y, w, h, T1
; some adjustments to get coordinates to align.
; the sketchup trays don’t report window sizing the same as other windows, so had to adjust
if (mon = 1)
{
x1 := x - defW - 1
}
else
{
x1 := x + defW + 1
}
y := defT + 1
; move and size tray 2 equal to tray 1
; the +10 was added here to resize the window to work around a SketchUp bug.
; the next line can be removed once SU fixes the bug
WinMove, T2, x1, y, defW+10, h ; remove when bug is fixed
WinMove, T2, x1, y, defW, h
if (mon = 1)
{
x1 := x1 - (defW - 1)
}
else
{
x1 := x1 + (defW + 1)
}
; move and size tray 3 equal to 1 and 2
; the +10 was added here to resize the window to work around a SketchUp bug.
; the next line can be removed once SU fixes the bug
WinMove, T3, x1, y, defW+10, h ; remove when bug is fixed
WinMove, T3, x1, y, defW, h
; move model info to new coordinates
if (mon = 1)
{
WinGetPos, x, y, w, h, Model Info
x1 := (x1 - w + 6)
}
else
{
WinGetPos, x, y, w, h, T3
x1 := (x1 + w - 6)
}
y := defT - 1
WinMove, Model Info, x1, defT
WinGetPos, x, y, w, h, Model Info
if WinExist(“Profile Dialog”)
{
; adjust coordinates for profile builder
y := h + 24
h := defH - h + 12
; move profile builder dialog under model info
WinMove, Profile Dialog, x, y, w, h
}
}