Trigger: Text Shared to MacroDroid
Revision as of 21:48, 7 January 2026 by MacroDroidDev (talk | contribs)
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.
Options
- Text to Match: Specify a pattern to filter which shared text triggers the macro (supports Magic Text)
- 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
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
Triggers Text Shared to MacroDroid (http)
Actions Open URL: [shared_text] Log Entry: Opened shared URL
Open any shared URL containing "http" in the browser.
Triggers Text Shared to MacroDroid (.*)
Actions
Set Clipboard: [shared_text]
Write File: /sdcard/shared_notes.txt - Append
[shared_text]
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.