| Line 1: |
Line 1: |
| − | == About ==
| + | <pre class="header-style">The Macro Enabled trigger fires whenever the macro containing this trigger is enabled. This can happen when the macro is manually switched on, when its category is turned on, or when the macro is enabled via another macro.</pre> |
| − | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;"> | + | |
| − | This trigger will fire whenever this macro is enabled.
| + | ''' Options ''' |
| − | This can happen when the macro is manually switched on, via the category being turned on or enabled via another macro. | + | |
| − | </pre> | + | This trigger has no configurable options. It automatically fires when the containing macro is enabled. |
| | + | |
| | + | ''' Examples ''' |
| | + | |
| | + | ''Example 1: Initialize Variables on Enable'' |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Macro Enabled</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Set Variable - counter = 0 |
| | + | Set Variable - last_run = [date_time] |
| | + | Popup Message - Macro initialized</pre> |
| | + | |
| | + | Initializes variables and shows a confirmation when the macro is enabled. |
| | + | |
| | + | ''Example 2: Start Background Service on Enable'' |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Macro Enabled</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Enable Macro - Background Monitor |
| | + | Set Variable - service_running = true</pre> |
| | + | |
| | + | Enables a related macro and sets a status variable when the main macro is enabled. |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * The trigger fires when the macro transitions from disabled to enabled state. |
| | + | * It fires for any method of enabling the macro: |
| | + | ** Manual toggle by the user |
| | + | ** Category being enabled |
| | + | ** Enable Macro action from another macro |
| | + | |
| | + | ''' Use Cases ''' |
| | + | |
| | + | * Initializing variables when a macro starts |
| | + | * Displaying setup/welcome messages |
| | + | * Starting related services or macros |
| | + | * Logging macro activation times |
| | + | * Performing one-time setup tasks |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Trigger:_Macro_Finished|Macro Finished Trigger]] |
| | + | * [[Trigger:_MacroDroid_Initialised|MacroDroid Initialised Trigger]] |
| | + | * [[Action:_Enable/Disable_Macro|Enable/Disable Macro Action]] |