Difference between revisions of "Constraint: MacroDroid Invocation Method"

m
 
(One intermediate revision by one other user not shown)
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 how the macro was invoked.</pre>
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
This constraint can be used to allow/prevent functionality based on what caused the macro to be invoked. For example, if it was invoked from the MacroDroid Drawer or as a result of a user selecting an option within an Option Dialog.
 
  
This constraint should be used on individual triggers and actions (or within IF conditions) and it should not be applied at the whole macro level.
+
''' Options '''
 +
 
 +
* '''Invoked by / Not invoked by''' - Choose whether to match or exclude selected methods
 +
* '''Methods''' - Select one or more invocation sources:
 +
** '''Animation Overlay'''
 +
** '''Custom Scene'''
 +
** '''Floating Button'''
 +
** '''Floating Text Click'''
 +
** '''Google Assistant'''
 +
** '''Macro Run Action'''
 +
** '''MacroDroid Drawer'''
 +
** '''Notification'''
 +
** '''Option Dialog'''
 +
** '''Other Standard Trigger'''
 +
** '''Overlay Bar'''
 +
** '''Power Menu'''
 +
** '''Quick Run Tile'''
 +
** '''Shortcut'''
 +
** '''Test Actions'''
 +
** '''Test Macro'''
 +
 
 +
''' Example '''
 +
 
 +
''Example 1: Set a variable to a different value based on how the macro was invoked''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Empty Trigger
 +
</pre>
 +
  <pre class="action-style">Actions
 +
If (Macro Invoked by FloatingTextClick)
 +
  Set Variable: count = 10
 +
ELSE
 +
  Set Variable: count = 100
 +
ENDIF
 
</pre>
 
</pre>
 +
 +
 +
''' See Also '''
 +
 +
* [[Constraint: Trigger Fired|Trigger Fired Constraint]]

Latest revision as of 13:13, 9 January 2026

This constraint allows or prevents a macro/feature from running based on how the macro was invoked.

Options

  • Invoked by / Not invoked by - Choose whether to match or exclude selected methods
  • Methods - Select one or more invocation sources:
    • Animation Overlay
    • Custom Scene
    • Floating Button
    • Floating Text Click
    • Google Assistant
    • Macro Run Action
    • MacroDroid Drawer
    • Notification
    • Option Dialog
    • Other Standard Trigger
    • Overlay Bar
    • Power Menu
    • Quick Run Tile
    • Shortcut
    • Test Actions
    • Test Macro

Example

Example 1: Set a variable to a different value based on how the macro was invoked

Triggers

Empty Trigger
Actions
If (Macro Invoked by FloatingTextClick)
  Set Variable: count = 10
ELSE
  Set Variable: count = 100
ENDIF


See Also