Difference between revisions of "Constraint: Clipboard content"

 
Line 1: Line 1:
<span style="color: #0E9549; font-size: 24px;">'''About this constraint '''</span>
+
<pre class="header-style">This constraint allows or prevents a macro/feature from running based on the current clipboard text.</pre>
  
This constraint can be used to allow a trigger to fire only when the contents of the clipboard match a specified text string.
+
''' Options '''
  
<span style="color: #0E9549; font-size: 24px;">'''Please note that'''</span>
+
* '''Text Match''' - Match specific text or patterns
 +
* '''Enable regular expression matching''' - Use regex for advanced matching
 +
* '''Case insensitive''' - Ignore uppercase/lowercase differences when comparing text
  
This constraint can only work on Android 10+ if you have used the clipboard refresh action previously to update the latest known clipboard text in MacroDroid.
+
''' Example '''
  
''See also: [[Action: Clipboard Refresh|Clipboard Refresh]].''
+
''Example 1: Share a copied URL only when the clipboard contains a link''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Widget Button</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Share Text</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Clipboard content - Contains "http"</pre>
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger: Clipboard Change|Clipboard Change Trigger]]
 +
* [[Action: Share Text|Share Text Action]]

Latest revision as of 11:17, 9 January 2026

This constraint allows or prevents a macro/feature from running based on the current clipboard text.

Options

  • Text Match - Match specific text or patterns
  • Enable regular expression matching - Use regex for advanced matching
  • Case insensitive - Ignore uppercase/lowercase differences when comparing text

Example

Example 1: Share a copied URL only when the clipboard contains a link

Triggers

Widget Button
Actions

Share Text
Constraints

Clipboard content - Contains "http"

See Also