#!/bin/bash
# Геометрия окна Windows App через System Events (нужен Accessibility для Claude.app).
# Печатает: X Y W H  (позиция левого верхнего угла и размер в координатах экрана).
# Использование: rdp_win.sh [имя_процесса]   (по умолчанию "Windows App")
set -euo pipefail
PROC="${1:-Windows App}"
osascript <<AS
tell application "System Events"
  tell process "$PROC"
    if (count of windows) = 0 then error "нет окон процесса $PROC"
    set w to window 1
    set p to position of w
    set s to size of w
    return ((item 1 of p) as string) & " " & ((item 2 of p) as string) & " " & ((item 1 of s) as string) & " " & ((item 2 of s) as string)
  end tell
end tell
AS
