SUBMACRO: sm.𝗽𝗮𝗹𝗲𝘁𝘁𝗲⇾MoveMouseToPalette, v4.0

Hi, @peternlewis. In the above submacro, I use the following AppleScript to get the position of a palette created with the Show Palette of Macros action.

tell application "System Events"
	tell process "Keyboard Maestro Engine"
		get position of window 1
	end tell
end tell

I tried to retrieve the bounds, but got these errors:

  • 2023-11-17 10:01:54 Action 15394072 failed: Execute an AppleScript failed with script error: text-script:109:115: execution error: System Events got an error: Can’t get bounds of window 1 of process "Keyboard Maestro Engine". (-1728)

When I look at the Keyboard Maestro Engine AppleScript Dictionary it seems that bounds should be available. What am I missing? TIA


I was hoping to get the bounds so that offset could be defined as a percentage of palette width and palette height. In the above macro, I resorted to using absolute pixels from the palette top-left.


2023-11-18 12:4619 EST Update: I discovered that I can return the size, so I can achieve my objective.

tell application "System Events"
	tell process "Keyboard Maestro Engine"
		tell window 1
			set lstPosition to position
			set lstSize to size
			return lstPosition & lstSize
		end tell
	end tell
end tell

However, I still don't understand why bounds seems to be invalid.