SUBMACRO: sm.𝗮𝗽𝗽⇾WindowScreenshot (of a Prompt with List)

Often when sharing a macro on the forum I've wanted to include a screenshot of a list rendered by a Prompt With List (PWL) action. This task can be tricky since the keystroke used to capture the screenshot closes the list before the list can be captured.

In the past I've worked around this issue by using a screenshot delay timer, invoking the macro to render the PWL list, then waiting as the timer expires to capture the PWL list. This method works, but has a two shortcomings:

  1. The timer-delayed screenshot is area (versus a window), thus screenshot cropping becomes necessary.

  2. In some cases, I've found it difficult to advance to the rendered PWL list before the timer expires.

It's a new year, thus I thought that it's finally time to address this annoyance.


At the risk of being embarrassed by someone that has a much simpler solution, I'm sharing the method I'm now using. It does address both issues and after a straightforward set-up is easy to use.

Step 1 (completed one time)

  • Import the below submacro. It can be saved anywhere within your macro library.

  • By default, the native macOS method will be used. If you want to use this method (now or later), confirm that your keyboard shortcut (⇧⌘4) is enabled. Refer to macOS System Settings... > Keyboard (section) > Keyboard Shortcuts... (button) > Screenshots (section) > Copy picture of selected area to the clipboard.

    Note that this macOS keyboard shortcut has two modes: area (as indicated in the above label) and window (initiated by pressing <space> once the selection crosshair appears). This macro will prompt to use the <space> toggle, if required.

  • If you'd like to use another method (now or later), open the last group in the macro and make sure that the keystroke matches the configuration of your tool. For example, I use CleanShot X and I have configured ⌃⌥⇧⌘F4 for CleanShot X (app) > Settings... > Shortcuts (tab) > Screenshots (section) > Capture Window:.

  • If you want to use your screenshot tool by default, then change the local_DefaultMethod setting to -1.

Step 2 (completed as needed)

  • Import the below action. It's not required, but I recommend adding it to your Favorite actions using Actions > Add to Favorites.

  • Insert this action in your macro to be demonstrated. It can be inserted anywhere above the PWL of interest (due to a delay feature), but the easiest approach it to insert it just above the PWL.

  • Confirm that Asynchronously is selected. Although it's unlikely necessary, optionally set the With Parameter value. See the action comment for more information.

  • If you have multiple PWL's, multiple copies of the action can be inserted (again above the respective PWL).

  • Run your macro and capture the PWL lists as windows.

  • Delete (or disable) the inserted actions.


Download: sm.𝗮𝗽𝗽⇾WindowScreenshot.kmmacros (23 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 15.3 (24D5034f) PRE-RELEASE SEED SOFTWARE
  • Keyboard Maestro v11.0.3

Download: [ insert this group action to capture a window screenshot ].kmmacros (4.9 KB)

Keyboard Maestro Export

Interesting -- I find that the "standard" ⌃⇧⌘4 doesn't close the prompt. Am I just lucky?

1 Like

Nope, works fine here too—I had to test, though, as I've had it programmed onto a mouse button for literally a decade, so it's been a long time since I tried the actual key combo :). But yea, it works fine.

-rob.

1 Like

More likely I’m just unlucky. :cry:

For other unlucky souls, see if this method works for you. I’m able to now use the macOS native method and CleanShot X (my preferred).

1 Like