I've got a named clipboard with fomatted text and images. I have a macro that pastes that clipboard into Mail.app. I built the macro using some tricks from this thread. In the past it would paste rich text, but today it's pasting plain text.
When I look at the text in Preferences > Clipboard I see my images and formatted text.
Things I've tried:
If I select all the text in Preferences > Clipboard, copy, and paste into Mail.app or TextEdit.app the formatting and images disappear.
If I copy the named clipboard to the system clipboard and paste into Mail.app or TextEdit.app the formatting and images disappear.
If I drag the icon next to the named named clipboard to the system clipboard into Mail.app or TextEdit.app the formatting and images are there.
Thanks. I tried that and it worked a few times, but then I lost the rich text. I kept going and just tried it again. What I found is that it would happen intermittently. Every 2nd-4th time. The lack of rich text might repeat a few times, then I could paste rich text again. I couldn't find a pattern to make sense of it.
I'm using Version 9.2 of Keyboard Maestro
macOS version 11.6
If I deleted the plain text version at the top, it would re-appear.
Now I can't get it to repeat. What shows up in the clipboard history is plain text, every time. No matter where I copy from, that i know has rich text, it shows up as plain text. I do have earlier entries that will, sometimes, show up as rich text that were part of the script I've been working on.
Images copy fine.
I once worked in Q.A. but I am not sure how to track this down or what to try! Any ideas are welcome.
The clipboard generally contains, at any given moment, several different pboarditems, each representing the current data in a different format, and each with its own identifying label.
the choice of which of these pboarditems to use, when a paste is requested, is up to the receiving application – in this case Mail.app
First thing to check, is Mail in plain text or rich text mode, when this happens ?
Second, what set of pboarditems is actually in the clipboard when this happens ?
(There’s a Clipboard Viewer macro on this forum, which shows the bundle ids of the pboarditems currently in the general pasteboard)
Yes. I made sure the mail.app settings were to open new emails in rich text mode. But then I started going back to see what was being copied. I've noticed this in other applications too so I think it's being copied as plain text.
Great question and I think this is narrowing it down.
I made a quick macro using your Clipboard View (well done by the way). Mine simply activates text edit where I have some rich text, copies what's selected, then runs your macro.
The result is:
{
"public.utf8-plain-text as string": "This is rich text.",
"public.utf8-plain-text as data": "This is rich text."
}
So it seems to be only copying in plain text right?
If so, I'm wondering what setting I may have set or program I may be running that would do this? It's happening on my laptop and desktop (though I did copy over a lot of settings).
Silly question -- but do you have the same problem if you've quit the Keyboard Maestro Engine before copy/pasting?
I'd noticed there's a "Remove Styles" macro, and wondered if maybe you'd unwittingly enabled something similar that was activated by the "Clipboard Changed" trigger.
I did turn off the engine again just to double check and gave it a shot. Same result.
I hadn't thought about that "Remove Styles" macro and disabled that one and a "Remove Formatting" one just to be sure. But still not able to copy rich text.
Thanks for the validation!
So if I'm quitting the engine and it's still happening, does that rule out Keyboard Maestro as the source of the problem?
and at that stage, just after copying, what does the clipboard viewer macro reveal in the clipboard ?
If there's just plain text in the clipboard after a TextEdit ⌘C,
then has ⌘C been reassigned, as a hotkey, from the application's default Edit > Copy to some kind of KM macro ?
i.e. perhaps mysterious trouble in copying rich text.
Here, for example, after selecting and copying this selection from TextEdit:
I have both public.rtf and public.utf8-plain-text pboardItems in the clipboard:
{
"public.rtf as string": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2580\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;\\f1\\fswiss\\fcharset0 Helvetica-Bold;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\pard\\tx720\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\pardirnatural\\partightenfactor0\n\n\\f0\\fs24 \\cf0 alpha \n\\f1\\b beta \n\\f0\\b0 gamma}",
"public.utf8-plain-text as string": "alpha beta gamma"
}
Maybe? But wouldn't that end once I quit the Keyboard Maestro engine?
I also thought it might be some other program - but what could override ⌘C across everything?
Wait a second...
AH HA!
I just went through all my keyboard shortcuts in system preferences, checked every service. Then I checked applications looking for something that would be constantly running and overriding ⌘C.
I heard about TrackerZapper way back when and thought "why not". I have had it running since. But suddenly it was suspect!
I turned it off – I could copy rich text! I updated TrackerZapper – just to see – and I could copy rich text! So I had an old version of TrackerZapper running and just forgot about it. Ugh.
However, @ComplexPoint and others, your help was not in vain! I only really noticed this show up when I was running these macros. By being able to eliminate Keyboard Maestro I was able to narrow it down. (Still not sure why it was intermittent, but I'm ok not knowing now that it's solved.)