Display image in named clipboard : problems with trigger and exit

I frequently consult technical charts (not astrology!) and was looking for a a quick way to display / close them.
The quickest way that I found was to copy the image and paste it into a named clipboard. Saving the image, copying the file path→ pasting into a macro i find too time consuming, and the copy paste method allows me to modify → copy → paste the images with minimal effort.

Because these are simply images for quick reference, I want to be able to close the image quickly, and to improve efficiency, I want to trigger the macro and close the image with modifier keys..

I have come across 2 problems:

  • i configured the macro to be triggered by simultaneously pressing Left Ctrl and Option keys, but this trigger works only intermittently.

  • I would like to be able to close the image using modifier keys, because in certain apps Esc causes problems (I am following the lead of @griffman 's use of modifiers), in this case with Shift Ctrl, but this does not work, either because the trigger does not work or because the actions to close the image does not work. I tried both the close last engine window and the close name of window actions.

thanks in advance for your time and help

display named clipboard $wip.kmmacros (30.3 KB)

I don't think you can reliably use "modifier plus modifier" as a trigger; I've never had much luck myself, which is why I use a single modifier with multiple taps.

For ending the macro, don't make it a one-time If, use an Until action waiting for those modifier keys to be pressed. Don't put anything in the until action, it's just sitting there watching the keyboard. Move the Close statement outside the Until, so it executes after the Until loop exits.

-rob.

1 Like

It's because you're opening/moving the clipboard then instantly testing for the modifier keys -- by the time you've pressed them your macro has moved on. You probably want to

open/move clipboard
pause until ⌃ and ⇧ are pressed
close the clipboard

(although I'd find it easier to use the normal ⌘W myself...)

For the "doesn't always trigger" problem -- check your macro group's "activation rules". I've seeing the "Activate for one action" set, but nothing checked within that. Start by setting it to be "Always active" and work from there.

1 Like

thank you. All clear and it works now. Just to make sure I understand: I could not find a close clipboard action. I assume you meant close last engine window ?

thank you. Works fine with your and @Nige_S 's explanations. Thank you to both of you

This macro was designed to be integrated into your superb decision maker macro. MACRO: The Decision Maker macro controller - Macro Library - Keyboard Maestro Discourse

1 Like

I am playing around with different uses of named clipboards to display reminders instead of display text in a window or as a notification.
Would you know if there would be a way to specifically close a displayed named clipboard without using the generic close last engine window ? I also tried closing the window with the title "clipboard entry" but it did not work.
thank you !

You need to use the window ID:

...which you can get immediately after opening the Named Clipboard window:

If you are dealing with multiple windows you could store name,ID pairs in a Dictionary or similar.

1 Like

works perfectly. thanks very much!.
there is a microscopic typo in your solution (I think) in Set Variable Local_WinID
image