How to transform text (to formatted text)?

Is there a predefined action or another way to transform text?
For example from that to that:
image

Ah I missed the text transformer actions when I recently added the format additions.

With 3.777 this is now possible, e.g. using HTML:

async (clipboardContentString) => {
   return `
<b style="color:red; text-decoration:line-through">${clipboardContentString}</b>
`
}

You would need to edit the HTML/CSS (the part inside of the tick marks) to fit your exact needs regarding font etc.

Ok, thanks, but I can't do that. Then I have to do it with another app.

Ok, it's pretty simple though. You can use any HTML editor to create that html part, e.g.

Online HTML Editor - π—›π—§π— π—Ÿ-𝗒𝗻𝗹𝗢𝗻𝗲.𝗰𝗼𝗺 (html-online.com):

Are there other tools that can do this more easily?

1 Like

Yes, below the simple macro from Keyboard Maestro.

The text is selected, copied and then transformed as I have previously defined. At the end the transformed text is pasted again.

Ah that's interesting, that might also be a good addition to BTT at some point.

1 Like

Ok, I have tried it. Not rocket science, but not so easy either do it accurately for someone who doesn't code :slight_smile:

It changes font and size :man_shrugging:

image

Probably I better stay with KM until BTT makes it easier :slight_smile:

@Andreas_Hegenberg I'm sure you have more than enough to do. However, if you ever find the time, a simple way to transform text is still something I would really like to see in BTT. :slightly_smiling_face:

@Andreas_Hegenberg May I ask whether this is still on your agenda? A simple way to change text (as shown above) but with BTT would help me a lot. :slightly_smiling_face:

I think I implemented everything that would be required for this while working on floating menus. I'll check whether I can easily reuse that.

Sehr gern.

@Frank1

v5.091 added a basic implementation of this. There are now these additional predefined actions:

  • Copy Text Style / Formatting
  • Paste Text Style / Formatting
  • Change Formatting Of Selected Text
  • Change Formatting Of Clipboard Contents

Currently it allows to change some basic elements like font size, color and background color, or alternatively allows to input a preformatted template string, which's style will be transferred to the selected text (font-size can be ignored)

Danke, Andreas. Ich freue mich, wie ein keines Kind :tada:

Now I still need to understand how it works.

I select text and trigger (with a shortcut) the action below. Then the selected text should take on the format in the text field?

Unfortunately this does not work for me.

Edit: Ah, sorry, verstanden, so funktioniert es

If you use the "Change Formatting Of Selected Text" action instead, you should be able to remove the cmd+c and cmd+v

You are right. So the action β€œChange Formatting Of Clipboard Content” is intended to change something that is already in the clipboard?

Anyway, that's great, thanks again!

Correct!

1 Like