Clipboard issue KM9

Hi all.
After updating KM8 to 9 version I have trouble with calculating System Clipboard Value.
Below you can see a part of macro which increases the number from the clipboard by 1.
In KM8 these 4 actions worked correctly. After update when I copy from notepad some number to clipboard (and it exists in system clipboard) KM cannot see the current contents of the clipboard, only the name of the macro that I copied earlier.
I don't have any macros that are triggered by clipboard changes.
BTW. Sorry for my english. It isn't good enough.
Thanks ind advance!.

Honestly, I don’t understand your posted macro snippet:

In action 1 you set the variable clipboard_quantity to 0, then immediately in action 2 you replace it with the contents of the system clipboard. So, action 1 is completely superfluous, right?

Then you perform a calculation (+1) on that variable (with the system clipboard contents). But, obviously, this can only work if the variable contents is a numeric value, which doesn’t seem to be the case here.

Maybe it would be a good idea to post a screenshot of the entire macro, and also the macro itself (for download).


Sorry, just seen now that this is your first post.

See here how to upload a macro. Or simply export the macro (Keyboard Maestro > File > Export Macros…) and then drag the exported macro file into the forum editor window in your browser.

Welcome to the forum :slight_smile:

1 Like

The first action is to clear the variable.

InDesign | Wstaw plakat poziomy A1.kmmacros|attachment (2.8 KB)

Your macro works fine here if the clipboard contains a numeric value.

As said, you don’t need the “Set Variable to 0” action.

What do you think could be the reason?
When I run KM8 it works fine.
When I run KM9 It can't see "6" in the clipboard, just the previous contents of the clipboard or says that there is nothing in the clipboard.

OK, I’ve tested the macro with some numbers in the “Stickies” app. Worked fine there. Then I tried it in “Notes” and it doesn’t work.

Give me a minute or two…

1 Like

OK, you don't have to rush. Thank you for your commitment :slight_smile:

So far the macro works for me in BBEdit, Pages, Numbers, Stickies, MS Word. It doesn’t work in Notes (the ⌘C keystroke action doesn’t seem to work here).

Which app are you using where it doesn’t work?

Adobe InDesign

Yep. In InDesign it doesn’t work for me either. Weird. Does it work for you in the apps I have listed as working above?

After some more tests: The macro so far works in all apps, except Notes, InDesign, Illustrator.

in BBEdit, Stickies, Excel, Word, Visual Studio Code, Chrome works.
In Illustrator works only in panel menus (for example in font size input box)
in Notes, InDesign, Photoshop it doesn't work

1 Like

So, my guess is, this is a KM9 bug, @peternlewis ?

interestingly, the copy action works. the number is in the clipboard, but KM cannot see it.

In the mentioned non-working apps the copy action doesn’t work for me. The clipboard holds the number from the last app where it was working.

I will be looking in to this issue soon.

Thank you, Peter.

OK, v9 changed such that if there was an error in any flavor, then it would fail to read the rest of the clipboard. Apparently there is always an error reading the dyn.ah62d4rv4gk81n65yru (an old styled text flavor) in Notes, and for Mail it is dyn.ah62d4rv4gu8y4znmkfwgk6xfsr3za2pxsvw0e55bsmwfk8puqy (an old style of MUIAddressPasteboardType). The old version covered up this error.

I have fixed this for the next version, which should be out soon (maybe a week, depending on various factors). If you want to try, you can avoid these flavors using:

defaults write com.stairways.keyboardmaestro.engine ExtraIgnoredClipboardFlavors 'dyn.ah62d4rv4gk81n65yru|dyn.ah62d4rv4gu8y4znmkfwgk6xfsr3za2pxsvw0e55bsmwfk8puqy'

I think that would resolve the issue in Notes and Mail (unless there are other erroring flavors). There are likely other flavors in other applications.

Sorry for the hassles.

1 Like

Thanks Peter. So how can I work around this error in InDesign?

In Notes, now the selected number does get copied to the system clipboard (by the ⌘C action), but the OP’s macro still fails. Now with this error:

Set Variable to Calculation failed to evaluate Local_clipboard_quantity+1

(It works fine in most other apps, like for example Stickies.)

Yes, the Adobe apps seem to be concerned too, see here.