| Line 1: |
Line 1: |
| − | <span style="color: #B22A2A; font-size: 24px; display: inline-block; margin-top: 15px; margin-bottom: 0px;"><strong>About this trigger</strong></span> | + | <pre class="header-style">This trigger will fire when you attempt to share text from an application and select MacroDroid as the target. This allows you to create macros that process text shared from any app that supports Android's share functionality.</pre> |
| | | | |
| − | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px; margin-top: 5px; margin-bottom: 5px;">
| + | ''' Options ''' |
| − | This trigger will fire when you attempt to share text from an application and select MacroDroid As the target.
| |
| | | | |
| − | also includes magic text when activated, check it here
| + | * '''Text to Match''': Specify a pattern to filter which shared text triggers the macro (supports Magic Text) |
| − | </pre>
| + | * '''Match Type''': |
| | + | ** '''Matches''': The shared text must exactly match the specified pattern |
| | + | ** '''Contains''': The shared text must contain the specified pattern |
| | + | * '''Enable Regex''': When enabled, the text pattern is treated as a regular expression |
| | + | * '''Ignore Case''': When enabled (and regex is disabled), matching is case-insensitive |
| | + | * '''Save Extras to Dictionary''': Optionally save the intent extras to a dictionary variable for advanced processing |
| | | | |
| − | ''See also: [https://macrodroidforum.com/wiki/index.php/Magic_text#Text_Shared_to_MacroDroid Magic text - Text Shared to MacroDroid].'' | + | ''' Local Variables ''' |
| | + | |
| | + | This trigger provides access to the shared text through magic text variables. The shared text content can be accessed and used in actions. |
| | + | |
| | + | ''' Configuration ''' |
| | + | |
| | + | Enter a text pattern to match. The trigger will only fire when the shared text matches your specified criteria. Leave the pattern empty or use a wildcard to trigger on any shared text. |
| | + | |
| | + | If you enable "Save Extras to Dictionary", you can select or create a dictionary variable to store the intent extras that come with the shared content. |
| | + | |
| | + | ''' Examples ''' |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Text Shared to MacroDroid (http)</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Open URL: [shared_text] |
| | + | Log Entry: Opened shared URL</pre> |
| | + | |
| | + | ''Open any shared URL containing "http" in the browser.'' |
| | + | |
| | + | ---- |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Text Shared to MacroDroid (.*)</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Set Clipboard: [shared_text] |
| | + | Write File: /sdcard/shared_notes.txt - Append |
| | + | [shared_text]</pre> |
| | + | |
| | + | ''Save any shared text to clipboard and append to a notes file.'' |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * MacroDroid appears in the system share menu when this trigger is configured and the macro is enabled. |
| | + | * Multiple macros can use this trigger with different patterns to handle different types of shared content. |
| | + | * The regex option provides powerful pattern matching for filtering specific content types. |
| | + | * Values saved to dictionary variables are automatically parsed to appropriate types (boolean, integer, decimal, or string). |
| | + | * Useful for creating quick actions for shared content like URLs, phone numbers, addresses, or selected text. |