save_attachments
Save attachments from an Apple Mail message to a specified folder. Optionally select specific attachments to save by their index.
Instructions
Save attachments from a message to a directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Mail.app account name or UUID. Supply it (with ``mailbox``) to take the faster IMAP path — one fetch instead of an account×mailbox AppleScript scan. Pass the same values you read the message with so attachment ordering matches (#371). Strongly recommended on Gmail, where the AppleScript fallback's unindexed cross-scan can take minutes and time out. | |
| mailbox | No | Folder the message lives in (e.g. "INBOX"), used with ``account`` for the IMAP fast path. | |
| message_id | Yes | Message ID from search results | |
| save_directory | Yes | Directory path to save attachments to | |
| attachment_indices | No | Specific attachment indices to save (0-based), None for all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||