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

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

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

Post by Petr » Fri Nov 25, 2016 11:53 am

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

Post Reply