Insert text from clipboard by typing

Hello,

is there a way, to insert text from the clipboard by typing instead of pasting?

I want to copy a text from apple numbers and then go to a folder in finder and type the copied text, so it highlights the file.

I hope somebody can help me.
Thank you very much!

Best regards
Dennis

Hi Dennis,

This is actually very easy to do with KM. In fact, I've had a macro in place for years explicitly for this purpose, as you never know when you'll run into a text field that refuses to accept a standard paste:

Type Clipboard.kmmacros (2.2 KB)
image

1 Like

Thank you!
I will check that.

I have this macro also, but I've embellished it by having my macro clear the clipboard after pasting. I added this extra step because I sometimes use the type-paste method to paste secure items like account numbers or passwords that I don't want lingering on the clipboard.

You don't need the "Set System Clipboard..." Action.
The first action, "Delete Past Clipboard 0" has already deleted the current System Clipboard.

Actually, that's intentional. I want an empty paste buffer. Deleting clipboard 0 replaces the clip buffer with clipboard 1, which isn't what I want.

I'm trying this, but if the text in the clipboard starts with @$ those two characters are ignored?

I'm afraid I don't know what to tell you, as I just tested typing the clipboard with @$ those two characters are ignored? from your post and it worked fine for me.

This is my entire macro:

As an example I put @$test in the clipboard "test" could be any string);

  • Command-V pastes @$test
  • this macro types test

When I check the clipboard history with Alfred I really see @$test.

Huh?

That's odd @rob. Mine works as expected and the same as @gglick's does...

Some possible troubleshooting questions:

  • What version of KM are you using?
  • What version of macOS?
  • Does this happen in every app, or only certain ones?
  • Does this happen with any other characters, or even the same ones in a different order (i.e. $@ instead of @$)?
  • Did you try quitting and restarting the KM engine? Your Mac?
  • KM: Version 9.0.5
  • macOS: Catalina, 10.15.5 (19F101)
  • I tried two terminals (iTerm, Terminal) and two editors (Sublime Text, TextEdit) and it happens in all of them
  • It seems to happen with prefix @$ and $@, but not with xx
  • The problem is occurring several days now and I always turn of my Mac at night (so it did "reboot")

Keyboard Maestro will be typing the keys. My guess would be either:

  • Your keyboard layout is confused.
  • Something is messing with the event queue.

Start by changing your keyboard layout.

You may also want to try either a Safe Boot, or creating a new user account and see what you see there.

My keyboard is set to "ABC" and seems to match the layout of the physical keyboard.

I noticed this:

  • If I put another character (-) in front before copying; the text is typed correctly: -$@test
  • If I put that other character in Keyboard Maestro before the %SystemClipboard%; the text is type correctly as well: -$@test

(Alfred always shows the correct text in the clipboard history)

Just out of interest is your ABC keyboard physical or on screen?
Either way, what make or software is it?
Do you have any autocorrect or escape sequences enabled?
What does it type when you test with @x where x is the top row of specials
e.g. !@£$%^&*()?

"ABC" is the macOS selection; the keyboard is a regular (wireless) Apple Magic Keyboard 2.

The top row is ±!@#$%^&*()_+.

Keyboard Macro types absolutely nothing for any of the characters when @ is in front of them (and only the second character if I use others characters like . and ,)

FAO Peter
Is it possible for there to be some sort of tool, similar to the KM mouse coordinates display that shows what "character code" KM is receivIng when a key combo is pressed or maybe a midi "note".

Hm. It even happens if I ask KM to type the literal text... (so the clipboard plays no role?)

image

This outputs (only) test.

Not sure if this is relevant but in Perl

I found that too when searching for those two characters, but I’m not using Perl (unless some App does that under the hood).