Debugging – System Clipboard Token Not Working

I have the "Start With" set to Clipboard, but the contents of the clipboard are not being entered - it keeps using the first clipboard item I had when I started experimenting with this macro, but it will not take subsequent clipboard items. Any idea how to fix this?

@Tomas thanks for your question.

I don't see the behavior you describe, but just to make sure we are on the same page, allow me to list the steps:

  1. In some app, select and copy some text, e.g., in TextEdit select and copy ABC.
  2. Start Log It using the keyboard shortcut, Shift+Cntrl+L.
  3. The main Log It dialog should be displayed. If Start With is set to Clipboard, the Content field should be set ABC.
  4. Continue within Log It by selecting Cancel, Save Setting Only, or OK.
  5. Return to some app, select and copy some other text, e.g., XYZ.
  6. Start Log It again using the keyboard shortcut, Shift+Cntrl+L.
  7. The main Log It dialog should be displayed. If Start With is set to Clipboard, the Content field should be set XYZ.

Assuming you can duplicate your issue when using the above steps, then something unique is occurring for you. If you think the macro may have been changed, I suggest deleting it and downloading it again.

Also, I can't think of any reason a setting would be causing a problem, but can reset the Log It settings to default values by launching it with Shift+Cntrl+Opt+L.

If none of the above works, then maybe the app you are copying from is not using the System Clipboard.

Lastly, I can try to duplicate the problem if you let me know what app you are copying from.

Hi Jim: Thanks for the quick reply. The problem is across the board with any program. The only change I have made to the Macro is to change the location of the log file to the desktop. The normal copy and paste functions (when not using Log It) work fine. I have tried deleting the Macro and replacing it, as well as clearing the Macro's settings, both of those do not fix the problem. Is this macro dependent on a particular OS? (I am on Sierra and have the current version of Keyboard Maestro.)

I'm using Keyboard Maestro v9.2 on Big Sur 11.2.1 and Mojave 10.14.6.

Just to confirm that the uploaded version is intact, I downloaded it just now and tested in on both of my Macs and it's running as expected.

Maybe this is a localization issue? Are you using English (US)?

Let's try this. I've created a debug version. Please download it, activate it, and run it. After you dismiss the first dialog by selecting OK you will see a test window open. Please copy that text and paste it into a reply.


PLEASE NOTE: THIS VERSION OF LOG IT IS FOR DEBUGGING ONLY!

Log It-DEBUG 2021-02-18 1.kmmacros (119 KB)


Here's what I see:

AFTER “Start With” Switch action
Log It-DEBUG 2021-02-18 1
jsLI__Start With : Clipboard
System Clipboard : ABC
local__Content : ABC

AFTER First dialog
Log It-DEBUG 2021-02-18 1
jsLI__Start With : Clipboard
System Clipboard : ABC
local__Content : ABC

Here's what I get in the test window:

AFTER “Start With” Switch action
Log It-DEBUG 2021-02-18 1
jsLI__Start With : Clipboard
System Clipboard : read rq 02-18-21 - 12:40
local__Content : read rq 02-18-21 - 12:40

AFTER First dialog
Log It-DEBUG 2021-02-18 1
jsLI__Start With : Clipboard
System Clipboard : read rq 02-18-21 - 12:40
local__Content : read rq 02-18-21 - 12:40

This is curious as what seems to be in the clipboard is what I copied there before running the Debug Macro - and the time is way off - it's showing something that was copied hours ago ("read rq 02-18-21 - 12:40"). What I copied just before running the Debug Macro was "ortant" (no quotes around it) - this will show up if i do a paste into TextEdit, my email program etc, so it is obviously in the clipboard, yet the data that the Debug Macro test window shows something different....almost like somewhere along the line the old contents are not getting flushed?

I also notice in the initial user input box of the Macro, the old data is showing up in the "Content" field, not "ortant"

Since jsLI__Start With = Clipboard, local__Content should equal the System Clipboard.

So that part, at least, makes sense.


I suspect that it's unlikely, but might you have another macro running in parallel that contains the Delete Past Clipboard 0 action?

More likely, it seems that something is fundamentally broken between the System Clipboard and the Keyboard Maestro Engine. The following macro could be used test that theory.


Show Clipboard.kmmacros (2.0 KB)


Other steps to try (in order).

  1. Restart the Keyboard Maestro Engine.
  2. Log out; log back in.
  3. Restart your Mac.

Hi Jim: Here's what I have done so far:

  1. Ran the Show Clipboard contents macro - it does not correctly show clipboard contents. Clipboard works fine between other apps.
  2. I disabled all Macros except for Log It - still have the same clipboard issue in Log It.
  3. Restarted KM Engine, logged out and back in, restarted computer - no luck with this either.
  • I don't think I have any macro with "Delete Past Clipboard 0" action, but is there a way to globally search for this? I would tend to think this is not an issue due to Item 2 not fixing the problem.

Any ideas?

And thanks, for you time on this - I appreciate it

Clearly something is interfering with System Clipboard/Keyboard Maestro Engine communication.

Might you have some third-party Clipboard Manager aside from Keyboard Maestro?

I'll give this some more thought, but I suspect @peternlewis might have some ideas.

No - no other clipboard manager installed....

What is showing in the Keyboard Maestro Clipboard History Switcher?

Hi Peter:

Sorry for the late reply.

How does one get the Keyboard Maestro Clipboard History Switcher to open/work?

I don't know if this has anything to do with anything, but when I look at the Clipboard Prefs, I do not see the System Clipboard listed - is this normal?

The system clipboard is working, because I can copy items and paste normally. If I run the Show Clipboard Macro, however the most recent item copied does not show in the resulting window (yet it will paste correctly in any application). (What does show up is a copied item from a seemingly random previous copy.)

If the KM Clipboard History pref has been set to 0, would that affect how the Show Clipboard Macro work and would it prevent the LogIt Macro from working? If so, is there a way to see what my KM Clipboard History pref has been set to?

You can either:

  • Or run it directly from KM launcher: Press Ctrl-Space, and type "clipboard history switcher" or something similar.

Typing the assigned keystrokes to open the Clipboard History Switcher does nothing. Hitting the "Try" button also does nothing. My previous questions remain...

Hey @Tomas,

Well, that's quite odd. Even if your Macro and its containing Macro Group are disabled, Try should activate it.

What version of Keyboard Maestro?

What version of macOS?

How many monitors in your setup?

Take a look through this: Clipboard History Switcher [Keyboard Maestro Wiki]

And see if any possible cause jumps out.

-Chris

Hi - I had checked out the Clipboard History Switcher Wiki before - unfortunately no help there...

Computer specs are: KM ver 9.2; Mac OS 10.12.6, iMac (27-inch, Late 2012), no additional monitors.

  • Would the Clipboard History Switcher work if If the KM Clipboard History pref has been set to 0? (...and would that prevent the LogIt Macro from working?) If so, is there a way to see what my KM Clipboard History pref has been set to? ...this may be grasping at straws...

Hey Tomas,

That could be a problem...

See Preferences Set by Command Line on this wiki page.

Run this in the Terminal.app to see what your history has been set to:

defaults read com.stairways.keyboardmaestro.engine MaxClipboardHistory

If this turns out NOT to be the problem:

  1. Create a new user on your system and install Keyboard Maestro in that user-space.

  2. Test for the problem.

Depending upon the outcome of the tests I have a couple of more ideas.

-Chris

1 Like

Hi CC:
The problem WAS that the Clipboard History was set to 0. Changing this fixed the problem.
Thanks very much for your help!

2 Likes

Excellent. It's great to have so many in the forum that are helpful!