Commands & Syntax > Commands > Clipboard >

Replace text - < clp_replace_text >() ... [Pro]


Clipboard Replace text
<clp_replace_text>("Old text","New text",What,Method)
Available in: Professional edition

This command modifies current clipboard content (all textual formats) by replacing or inserting a portion of the text in the clipboard. It is possible to replace string or matching wildcard or matching regular expression by other string.



Parameter name

Parameter description


Old text

Current text in the clipboard to match.


New text

New text to be inserted to the clipboard.



Tells whether plain text, wildcard or regular expression should be used to match the current text in the clipboard. The values are "text", "wildcard" or "regex".



Tells how to insert new text. Options are:
replace - The matching text in the clipboard is replaced by new text
insert_before - New text is inserted right in front of the matching text
insert_after - New text is inserted next to the matching text


Example (Macro Steps):



<#> <#>This macro shows how to replace xxx text in clipboard by current date


Clipboard COPY "Put date here: xxx"


Date & Time : DATE Insert or save to Variable Format=Windows user default - long, Separator=/, Day leading zero=Yes, Month leading zero = Yes, Day shift = 0, Variable for result = vDate


Clipboard Replace text Old text = "xxx", New text = "%vDate%", What = "Text", Method = "Replace text"

Example (Plain Text):


<#>This macro shows how to replace xxx text in clipboard by current date

<clpput>("Put date here: xxx")<#>