Paste menu item in the KM Status Menu

OK, so apparently I’m not the only one who never noticed this before. For those of you as blind as me:

In the Keyboard Maestro status menu, right near the top, is a “Paste” menu item. It provides quick access to recent clipboard items. Very useful.

1 Like

Good point Dan. I knew about it, but tend to forget it.

Are you going to make a macro to show the Paste menu?
If not, I’ll do so.

Macro? Or do you mean Screenshot? In either case, go for it.

Great. My 3rd quick access to the clipboard history, after LaunchBar and Copied. Can never have enough of them :yum:

1 Like

Tom, thanks for pointing out LaunchBar.
Just tested its Clipboard History, and it works great. Much better than the KM Paste menu:

LaunchBar Clipboard History

(scaled down to 75%)

KM Status Menu Paste

(scaled down to 75%)


@DanThomas, I started on the macro, but I'm getting a timing problem.
Since Tom mentioned LaunchBar, I don't need this macro, so I'm not going to finish it.

Here's the script I have so far, in case you, or anyone, wants to continue with it:

tell application "System Events"
  tell application process "Keyboard Maestro Engine"
    tell menu bar 2
      – -click
      tell menu bar item 1
        
        ignoring application responses
          with timeout of 0.5 seconds
            – -perform action "AXPress"
            click –  – this click is necessary to open the KME Status menu
          end timeout
        end ignoring
        
        – - – WHY is there a 6 sec delay at this point???
        
        delay 0.2
        
        tell menu 1
          tell menu item "Paste"
            click
          end tell
          
        end tell
        
      end tell
    end tell
  end tell
end tell

Thanks, I don’t need it.

Yes, LB’s clipboard history is great.

I don’t know if you already have discovered some things:

When you right-click on a history item you get a context menu that shows you the available actions (and shortcuts).

The most interesting one is the “Sent to…” action (Tab key): With this you can for example send a text from the clipboard history to the “Add Snippet” action, to convert it to a persistent snippet.

Or you can send it to an application, to a Service workflow, to one of your web search templates, etc.:

You can select multiple history items with ⇧↓ and ⇧↑, contiguous or non-contiguous. Depending on the content of the items you then can copy or paste them all together, or you can apply the “Send to…” to the whole selection.

Btw, you can search in your whole history simply by forward-typing, without ⌘F or alike.

Tom, many, many thanks for this. :thumbsup:

I did not know this stuff!

Like you said in another thread, the more one uses LB the more you like and learn about it.

If you hold the shift key down, it will paste plain text, and if you hold the option key down, it will just set the clipboard and not actually paste.

2 Likes

Is there a way to display the Paste menu in a macro? Or the clipboard history in the way it is presented in the Paste menu?

The problem with using the Show Status Menu action (or using an Applescript to do the same thing) is that it ties things up, so further KM actions will not be processed (unless ESC is pressed, a real mouse click occurs, etc.). A pretty good way around this is to use mouse clicks. Click at Found Image is not the answer, because KM will normally not find an image on the status menu. Click at Position also has potential problems, because the position of status menu items can change. Two examples are icons that might or might not have badges (like email message counts) and the day/date/time display (which can change width with different days and dates). The solution I use is to position the KM icon to the right of all other status menu items (just left of the Notifications menu). This is done by holding COMMAND while dragging the KM icon in the status menu. Then, just make a macro like the one below, only adjust the position of the mouse click so it works for your situation.

Paste from Status Menu Macro (v9.0.2)

Paste from Status Menu.kmmacros (2.8 KB)

The macro activates the first clipboard item, so you can easily navigate through the list with up/down arrow keys.

Thanks, I just learned what the Status Menu is thanks to you and also learned about all of those options. I completely missed that after all these years and there is even modifiers in there too as Peter pointed out.

1 Like

It never ceases to amaze me how many "obvious" things I never learned. KM certainly keeps us humble. :joy:

2 Likes

Sounds like a thread Dan. Today, I learned something that may be obvious to many folks but was very new to me. I was thrilled. Keyboard Maestro is the gift that keeps on giving. :smiley:

2 Likes

Hey Guys,

Don't forget this new feature of Keyboard Maestro 10:

Paste by Name

It's much handier for most things than the “Paste” status-menu-item, unless you're very mouse-centric and/or need the hidden capabilities of:

or

or

The best way to open the Keyboard Maestro status-menu hands free is to use a variation of this AppleScript:

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/11/28 05:19
# dMod: 2021/11/30 02:33
# Appl: Keyboard Maestro Status Menu & System Events
# Task: Open Keyboard Maestro Status Menu
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Open, @Keyboard_Maestro, @Status, @Menu
--------------------------------------------------------

tell application "System Events"
   tell UI element "Keyboard Maestro Engine"
      tell menu bar 2
         set kmStatusMenuPosition to position of menu bar item 1
      end tell
   end tell
end tell

set kmStatusMenuPositionX to (item 1 of kmStatusMenuPosition) + 15
set kmStatusMenuPositionY to (item 2 of kmStatusMenuPosition) + 10

set kmMacroXML to text 2 thru -1 of "
<array>
   <dict>
      <key>Action</key>
      <string>Click</string>
      <key>Button</key>
      <integer>0</integer>
      <key>ClickCount</key>
      <integer>1</integer>
      <key>DisplayMatches</key>
      <false/>
      <key>DragHorizontalPosition</key>
      <string>0</string>
      <key>DragVerticalPosition</key>
      <string>0</string>
      <key>Fuzz</key>
      <integer>15</integer>
      <key>HorizontalPositionExpression</key>
      <string>" & kmStatusMenuPositionX & "</string>
      <key>MacroActionType</key>
      <string>MouseMoveAndClick</string>
      <key>Modifiers</key>
      <integer>0</integer>
      <key>MouseDrag</key>
      <string>None</string>
      <key>Relative</key>
      <string>Absolute</string>
      <key>RelativeCorner</key>
      <string>TopLeft</string>
      <key>RestoreMouseLocation</key>
      <true/>
      <key>VerticalPositionExpression</key>
      <string>" & kmStatusMenuPositionY & "</string>
   </dict>
</array>
"

ignoring application responses
   tell application "Keyboard Maestro Engine"
      do script kmMacroXML
   end tell
end ignoring

--------------------------------------------------------

I run this from FastScripts, so all of the Keyboard Maestro actions are encapsulated as XML and run with do script.

It can run as-is in an Execute an AppleScript action, or you can use just this part of the AppleScript:

tell application "System Events"
   tell UI element "Keyboard Maestro Engine"
      tell menu bar 2
         set kmStatusMenuPosition to position of menu bar item 1
      end tell
   end tell
end tell

set kmStatusMenuPositionX to (item 1 of kmStatusMenuPosition) + 15
set kmStatusMenuPositionY to (item 2 of kmStatusMenuPosition) + 10

You'd then send those AppleScript values to Keyboard Maestro variables, and from there use a Move or Click Mouse action to actually click at the menu position.

This method prevents the hang of the native KM Show Status Menu action and other techniques.

-Chris

1 Like