How to paste text without formatting?

Hi,
I already have a script that normalizes text so it is no longer all uppercase. I added it to the clipboard scripts, and now I want to be able to copy some text and paste it normalized. I set up this command to do that, but it doesn't work. Do you have any idea why that is?
I hope you understand what I'm trying to do.

have you tried specifying the plain text paste option?

That worked one moment, but then not anymore.
What I also found weird was that if I copy some text in Illustrator and want to paste it as normal text, it doesn't work. When I open the clipboard manager, the copied text is not even in there. But I can paste it normally with cmd + v everywhere I can write.

Did you maybe disable BTT's clipboard manager for Illustrator? (I think there were some problems with Illustrator so some users disabled it)

Yeah, you are right. I disabled it. I totally forgot about that.
But the issue with the pasting text is still not solved. :confused:

does the paste action in general not work for you? (I tried plain text but it seems to be ok here).
Is this for Illustrator or in general?

No in general. I tested it with stickie notes. I don't know what I'm doing wrong.
This is how it looks on my side. :man_shrugging:

how does your normalize text function look like?

Here it is…

can you post the code? does it work with the example input ?

here is the code:

async (clipboardContentString) => {
  return clipboardContentString.split(' ') // Split the string into an array of words
               .map(word => word === word.toUpperCase() // Check if the word is in uppercase
                            ? word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() // Capitalize the first letter, make the rest lowercase
                            : word) // Leave the word as is if not in uppercase
               .join(' '); // Join the words back into a string
}

If I open the clipboard manager and apply the skript on the copied text, it works fine.