Trigger: File Shared to MacroDroid

This trigger fires when you share a file from another app and select MacroDroid as the target. You can optionally save the shared file to a new location.

Options

  • File Name Pattern - Match file names using exact match or contains
  • Enable Regex - Use regular expressions for advanced matching
  • Ignore Case - Case-insensitive matching (default on)
  • Save to New Location - Save the shared file to a chosen folder
  • Storage Access - Use the system file picker (SAF) or All Files Access
  • New Filename - Optional rename when saving (blank keeps the original name)

Magic Text

When this trigger fires, the following values are available via magic text:

  • {file_shared_name}
  • {file_shared_path}
  • {file_shared_directory}
  • {file_shared_uri}
  • {file_shared_mime_type}

Examples

Example 1: Auto-save shared PDFs

Triggers

File Shared to MacroDroid (Contains: .pdf, Save to new location)
Actions

Display Notification: "Saved {file_shared_name} to Documents"

Example 2: Open and log any shared file

Triggers

File Shared to MacroDroid (Any file)
Actions

Open File: {file_shared_path}
Write to File - Append "Shared {file_shared_name}" to shared_files.txt

See Also