Macro: List Properties of Front Window @Pub (v9.0.6)

Use Case

  • You are having trouble manipulating or accessing some window
    • None of the usual KM Window tools seem to work
    • Then Run this Macro (which uses AppleScript) To Get Properties of the Window, that KM does not otherwise see.
  • Using these Properties should help you devise a solution, but it may require AppleScript.

This Macro is based on a script written by Chris @ccstone in 2017.

  • Chris did all of the heavy lifting.
  • I just added some info and formatted the output.
  • Many thanks, Chris.

You May Also Be Interested In


Example Output

MACRO:   List Properties of Front Window @Pub

-~~~ VER: 2.0    2020-09-12 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

List Properties of Front Window @Pub.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


How To Use

  1. Make the target window frontmost
  2. Trigger this macro (without disturbing the window)
  3. The above report will be displayed.
  4. If you need help, copy the text of the report, and paste into a KM Forum topic.

ReleaseNotes

·························································································
Author : Christopher Stone scriptmeister@thestoneforge.com
Created : 2017/05/27 20:51
Modified : 2020-09-12 20:06 GMT-5 by JMichaelTX
·························································································
Task:
Create a report of properties of the front window that are available to AppleScript.

MOD by @JMichaelTX:

• Change Output to KM Window
• Move "Missing Value" Properties to Bottom
• ADD KM Window Properties
• ADD List of all Windows (KM & AppleScript)

·························································································

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. ??

Make These Changes to this Macro

  1. Assign a Trigger to this macro.
  2. Move this macro to a Macro Group that is only Active when you need this Macro.
  3. ENABLE this Macro, and the Macro Group it is in.

2 Likes

Very nice.

A perhaps natural extension would be to get the coordinates of a control. I had a use case the other day where I wanted to double click on a table row. I had to manually input some coordinates when it would’ve been better to know the coordinates of the control.

My macro is intended to provide the broad overview of a window, providing top-level properties.
There are any number of drill-down reports that would be useful.
Identifying what you call a "control" can be very complex in the window UI scripting model.
In those type of cases, a tool like UI Browser might be more effective.

Or, the user could use Script Debugger 7 to explore the UI model to find the "control" of interest. Once you find it you can get its position.

1 Like

Right, but that would be the static position and size of the control.

My guess is, given a reference to the object (say, a table row) in Applescript I might be able to acquire its position and size and then click or whatever there.

All the above seems cumbersome to me - and full of Applescript. I would love it if a Keyboard Maestro action called something like “click on control” existed. But I appreciate KM doesn’t really deal with controls and so the UI would be new.