I am seeing strange inconsistencies when trying to copy the system clipboard containing an image to a named clipboard.
- Copy an image (manually) with ⌃C
- Wait a long time
- Execute KM macro with a single action: Copy System Clipboard to Named Clipboard
- Try to paste from the named clipboard.
- The original copy to the system clipboard always succeeds. When I examine the contents of the system clipboard, the image is there.
- When I copy to the named clipboard, sometimes the behavior is as expected; the copied image ends up in the named clipboard.
- But sometimes the named clipboard is garbage. The value inspector describes it as a "Non-Text Clipboard," and future operations using the clipboard fail.
- The source and content of the image matter. I have not seen a failure with an image copied from Preview. I am very likely to see a failure with an image copied from LiquidText, although sometimes it succeeds.
Best to demonstrate with examples:
Value inspector showing both the System Clipboard and a clipboard named copylinkCopiedContent after using ⌘C to copy an image from a display in Preview.
The macro that I used to copy the System Clipboard to copylinkCopiedContent.
Value Inspector showing the contents of both clipboard after executing the macro.
Value Inspector showing the contents of both the System Clipboard and the named clipboard after using ⌘C to copy an image from LiquidText.
The System Clipboard looks fine here. When I look at clipboard info in AppleScript it looks like a perfectly normal clipboard. And when I paste the clipboard using ⌘V the image pastes perfectly.
But when I execute the macro to copy the System Clipboard to the named clipboard, Keyboard Maestro sees the named clipboard as garbage.
I have tried a number of obvious things, like clearing out the previous image in the named clipboard before doing the copy. I have not found anything that helps with the problem. I am also giving the system plenty of time between actions; sometimes timing matters with the clipboard.
I have not tried this out with a bunch of different applications. But this one demonstrates a circumstance where a System Clipboard that looks right in the KM Value Inspector and behaves correctly in all other respects cannot be copied to a named clipboard by Keyboard Maestro.
@peternlewis , this one is probably for you. I understand that Mac clipboards (i.e., Cocoa NSPasteboard objects) are complicated beasts. Any thoughts?
Keyboard Maestro Version 10.0.2, reported as current.
Running macOS Monterey Version 12.3.1, also current.