Changes

Created page with "<pre class="header-style">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 locat..."
<pre class="header-style">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.</pre>

''' 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''
<pre class="trigger-style">Triggers

File Shared to MacroDroid (Contains: .pdf, Save to new location)</pre>
<pre class="action-style">Actions

Display Notification: "Saved {file_shared_name} to Documents"</pre>

''Example 2: Open and log any shared file''
<pre class="trigger-style">Triggers

File Shared to MacroDroid (Any file)</pre>
<pre class="action-style">Actions

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

''' See Also '''

* [[Trigger: Text Shared to MacroDroid|Text Shared to MacroDroid]]
* [[Action: File Operation|File Operation]]
* [[Action: Open File|Open File]]