Hey Dan,
There's no way I know of to do this with Keyboard Maestro native actions.
The AppleScript is simple enough:
tell application "System Events"
tell application process "Keyboard Maestro Engine"
tell front window
set frontWinSize to its size
set frontWinPos to its position
end tell
end tell
end tell
You have to remember though that AppleScript thinks of multiple screens as one big Desktop.
Run this to see what I mean:
desktopBounds()
--------------------------------------------------------
--ยป HANDLERS
--------------------------------------------------------
on desktopBounds()
tell application "Finder"
set _bnds to bounds of window of desktop
return _bnds
end tell
end desktopBounds
--------------------------------------------------------
AppleScriptObjC can get the number of screens and various information about them, but as far as I know it cannot position windows itself. You have to translate that information as necessary and then use either a scriptable app itself or System Events to actually move the windows.
Since you have to work with AppleScript anyway, you might as well stay in AppleScript for this bit:
# Move the front Keyboard Maestro Engine Window
tell application "System Events"
tell application process "Keyboard Maestro Engine"
tell front window
set {position, size} to {{95, 23}, {516, 368}}
end tell
end tell
end tell
Here's how to get screen-information with AppleScriptObjC:
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/09/18 14:21
# dMod: 2021/09/18 14:21
# Appl: AppleScriptObjC
# Task: Get Information for All Connected Screens.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @ASObjC, @Connected, @Screens, @Information
# Test: macOS 10.14.6 (Mojave) or later is required.
--------------------------------------------------------
use AppleScript version "2.6" -- Mojave (10.14) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
--------------------------------------------------------
set allScreensInfoList to {}
set theScreens to current application's NSScreen's screens()
repeat with theScreen in theScreens
set theScreenInfo to theScreen's deviceDescription() as record
tell theScreen
set screenInfo to its visibleFrame()
end tell
set theScreenInfo to theScreenInfo & {|visibleFrame|:screenInfo}
set end of allScreensInfoList to theScreenInfo
end repeat
return allScreensInfoList
--------------------------------------------------------
-Chris