Macro Toolworks and Perfect Keyboard Forums • Filter formatted text out of the clipboard - leave only plain text
Page 1 of 1

Filter formatted text out of the clipboard - leave only plain text

Posted: Fri Nov 25, 2016 11:53 am
by Petr
This macro removes all text formatting (colors, bold, headings, etc.) from text copied to clipboard from rich text editors (for example Word) and leaves in the clipboard just plain text.

Code: Select all

<#> Start of the macro
<cmds>

<#> Assign only text data from clipdoard to variable vClipboardText
<var_oper>(vClipboardText,"",GET_TEXT_FROM_CLIPBOARD,"","","0")

<#> Is any text in variable?
<if_str>("vClipboardText==_vStrEmpty")

   <#> No text in variable - show message. 
   <msg>(-100,-100,"There is NO text in clipboard. ","Message",1)

<else>

   <#> Yes, there is text, put it back in to clipboard. 
   <clpput>("%vClipboardText%")
<endif>

<#> End of the macro