| Line 1: |
Line 1: |
| − | Trigger when certain text appears on the screen or when certain text disappears from the screen. It's possible to configure many settings here such as update rate
| + | <pre class="header-style">This trigger will fire when certain textual content appears on screen or is removed from the screen (as configured). Note that this trigger may not work for all apps/screen content as often text will be non-readable (for example if rendered within a game).</pre> |
| | + | |
| | + | ''' Options ''' |
| | + | |
| | + | * '''Text to Match / View ID to Match''' - The text string or Android view ID to search for on screen. Supports Magic Text for dynamic matching. |
| | + | * '''Match Text Content''' - Match against visible text content on the screen |
| | + | * '''Match View ID''' - Match against Android view IDs (for advanced users who know the specific view identifiers) |
| | + | * '''Enable Regex''' - Enable regular expression pattern matching for complex text patterns |
| | + | * '''Ignore Case''' - When enabled (default), text matching is case-insensitive. Not available when regex is enabled. |
| | + | * '''On Screen''' - Trigger fires when the specified content appears on screen |
| | + | * '''Off Screen''' - Trigger fires when the specified content is removed from screen |
| | + | * '''Select Applications''' - Limit detection to specific applications, or monitor all applications |
| | + | * '''Include Overlays''' - Include overlay windows in content detection (Pro feature) |
| | + | |
| | + | ''' Requirements ''' |
| | + | |
| | + | * UI Interaction Accessibility Service must be enabled |
| | + | * Pro version required for "Include Overlays" feature |
| | + | |
| | + | ''' Examples ''' |
| | + | |
| | + | '''Example 1: Low battery notification from app''' |
| | + | |
| | + | Trigger when a specific app shows "Low Battery" text: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Content (On Screen): "Low Battery" |
| | + | Applications: Smart Home App</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Display Notification: "Device battery is low" |
| | + | Send SMS to self: "Check smart home device battery"</pre> |
| | + | |
| | + | '''Example 2: Auto-dismiss dialog''' |
| | + | |
| | + | Automatically handle a recurring dialog that appears on screen: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Content (On Screen): "Rate this app"</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | UI Interaction: Click "Not Now"</pre> |
| | + | |
| | + | '''Example 3: Track work status''' |
| | + | |
| | + | Set a variable when work status changes: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Content (On Screen): "Available" |
| | + | Applications: Slack</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Set Variable: [work_status] = "available"</pre> |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * The trigger uses MacroDroid's UI accessibility service to query screen content |
| | + | * A delay of 500ms is applied between consecutive triggers to prevent rapid firing |
| | + | * Selecting specific applications is recommended to improve performance and reduce false triggers |
| | + | * A warning is displayed when "All Applications" is selected due to potential performance impact |
| | + | * Text rendered as graphics (such as in games or images) cannot be detected |
| | + | * The screen content update rate can be configured in MacroDroid settings |
| | + | * Magic Text can be used in the text to match field for dynamic content matching |
| | + | * On Android 15+ apps can block access to reading the screen content via the accessibility service. |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Action:_UI_Interaction|UI Interaction]] |
| | + | * [[Trigger: Notification]] |