How Do I Combine Complex Clipboard with Text?

I have a complex clipboard that I have copied from a web page. It contains:

  • Rich text
  • Images

I need to add text to the beginning of this clipboard, and retain everything else on the original clipboard.

Any ideas how to do this?

I’ve tried these KM Actions without success:

  • Set Clipboard to styled text
    • %Variable%TextToAdd%
    • %CurrentClipboard%
  • Set Clipboard to text (with same content as above)

That’s weird, sometimes it doesn’t work, but mostly it does now.

But when it works it greatly reduces the number of flavors on my clipboard.

Before, with the webpage copied (16 flavors):

After the KM action (6 flavors):

Apparently it merges the text with the flavors it understands and discards the others. However, the Rich Text flavors still hold the images from the webpage copy.

Sorry, but for me it consistently fails using:
Chrome 53.0.2785.116 (2785.116) on macOS 10.11.4

####Before Macro

Notice that Chrome is NOT actually putting the image on the Clipboard -- only the HTML code to the link for the image.

Somehow this is getting lost when KM merges the plain text with the clipboard.

####After Macro


I may have misunderstand your issue, but could this be modified to suit your needs?

Keyboard Maestro “Append to the Clipboard” Macro

Append to the Clipboard.kmmacros (5.2 KB)

Yes, my test was with Safari. It maintains the images after merging because of the RTF flavors.

I tried it with Chrome: the merging does work, but the clipboard looses the HTML flavor and the two RTF flavors are without images (as you said, the images were only in HTML as links).

Edit, PS: Firefox behaves exactly like Chrome. Opera too.

Thanks for confirming Tom.

I guess I'll just have to do two separate pastes, one with the text, and one with the rich text & images.

Yes. Or copying the webpage in Safari.