Macro Toolworks and Perfect Keyboard Forums • Test if clipboard contains text
Page 1 of 1

Test if clipboard contains text

Posted: Wed Nov 23, 2016 6:18 pm
by Petr
This macro shows how to test if clipboard contains text data.

Code: Select all

<#> Start of the macro
<cmds>

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

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

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

<else>

   <#> If yes, show message with content of clipboard
   <msg>(-100,-100,"There is this text in clipboard:
   %vClipboardText%","Message",1)
<endif>

<#> End of the macro