### Format String Syntax Examples Source: https://context7.com/mailmate/mailmate_manual/llms.txt Illustrates MailMate's format string syntax for variable substitution, conditional formatting, transformations, and regular expression substitution. Examples cover usage in key bindings, bundle format strings, and environment variables. ```plaintext // Basic variable substitution ${from.address} // Sender email address ${from.name} // Sender display name ${subject} // Full subject line ${subject.body} // Subject without Re:/Fwd: prefixes ${to.address} // Primary recipient ${date-received} // Received date // Conditional formatting ${var:?if:else} // If var exists: "if", otherwise "else" ${var:+if} // If var exists: "if", otherwise empty ${var:-else} // If var exists: var value, otherwise "else" ${var:else} // Same as above // Transformations ${from.name/upcase} // Uppercase ${from.name/downcase} // Lowercase ${from.name/capitalize} // Capitalize words ${subject/asciify} // Convert to ASCII // Regular expression substitution ${subject/regexp/replacement/options} // Examples in key bindings "^~d" = ( "selectWithFormatString:", "from.address = '${from.address}'" ); // Examples in bundle formatString formatString = "${from.address}\t${subject.body}\t${date-received}"; // Example in environment variables environment = 'MM_SENDER=${from.address}\nMM_SUBJECT=${subject}'; ``` -------------------------------- ### Generate Command Actions via Scripting Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Examples of outputting JSON-formatted actions from Ruby and Python scripts. ```ruby require 'json' actions = { actions: [ { type: 'moveMessage', mailbox: 'archive' } ] } print JSON.dump(actions) ``` ```python import json actions = { "actions": [ { "type": "moveMessage", "mailbox": "archive" } ] } print(json.dumps(actions)) ``` -------------------------------- ### Define Command Actions in Property List Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles A basic example of returning a moveMessage action using the property list format. ```text { actions = ( { type = "moveMessage"; mailbox = "archive"; } ); } ``` -------------------------------- ### Bundle Command Actions Example Source: https://context7.com/mailmate/mailmate_manual/llms.txt Demonstrates various action types that can be returned by MailMate bundle scripts, including moving, flagging, playing sounds, notifying, exporting, forwarding, and creating messages. Requires Ruby and JSON parsing. ```ruby #!/usr/bin/env ruby require 'json' # Move message to specific mailbox move_action = { type: "moveMessage", mailbox: "imap://user@imap.example.com/Archive/2024" } # Or use standard mailbox type move_to_archive = { type: "moveMessage", mailboxType: "archive" } # Change IMAP flags/keywords flag_action = { type: "changeFlags", enable: ["\Flagged", "Processed"], disable: ["\Seen"] } # Play notification sound sound_action = { type: "playSound", path: "Ping" } # Show notification notify_action = { type: "notify", formatString: '"${subject}" processed successfully' } # Export message to disk export_action = { type: "exportMessage", folderPath: "/Users/me/EmailArchive/" } # Forward message forward_action = { type: "forwardMessage", recipient: "team@example.com" } # Create new draft message create_action = { type: "createMessage", headers: { "To" => "recipient@example.com", "Subject" => "Generated message" }, body: "This message was automatically generated." } # Combined actions with result handling actions = { actions: [ flag_action, { type: "copyMessage", mailboxType: "drafts", resultActions: [ { type: "openMessage" } # Open the copied draft ] } ] } print JSON.dump(actions) ``` -------------------------------- ### Create Symbolic Link to emate Source: https://context7.com/mailmate/mailmate_manual/llms.txt This one-time setup command creates a symbolic link to the 'emate' executable, allowing it to be called from any directory in the terminal. ```bash # Create symbolic link to emate (one-time setup) mkdir -p ~/bin/ ln -s /Applications/MailMate.app/Contents/Resources/emate ~/bin/emate ``` -------------------------------- ### Alfred 2 Integration Setup Source: https://context7.com/mailmate/mailmate_manual/llms.txt Create a symbolic link to integrate MailMate with Alfred 2 for quick access to email actions. ```bash ln -s /Applications/MailMate.app/Contents/SharedSupport/Other/Alfred\ 2/MailMate.scpt \ ~/Library/Application\ Support/Alfred\ 2/Plugins/Email/ ``` -------------------------------- ### ROT13 Encoding Example Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Use this command in a Terminal window to apply ROT13 encoding to a string, as demonstrated for the `contactEmailRot13` key. ```shell printf "user@example.com" | tr '[A-Za-z]' '[N-ZA-Mn-za-m]' ``` -------------------------------- ### Disable Item Example Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Temporarily disable a command, filter, or theme by setting the 'disabled' keyword to 1. ```plist disabled = 1; ``` -------------------------------- ### Example MIME Part Data Structure Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles This JSON structure represents information about MIME parts saved by MailMate, including their MIME type, file path, and part IDs. This data is made available to scripts via the `MM_FILES` environment variable. ```json [ { "MIME":"image/jpeg", "filePath":"/some/temporary/path/example.jpeg", "partID":390, "rootID":386 }, { "MIME":"image/png", "filePath":"/some/temporary/path/example.png", "partID":391, "rootID":386 } ] ``` -------------------------------- ### MailMate Action: Move Message Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Example of an action-plist to move a message to a specified mailbox. Use MM_LOCATION for the current mailbox or a path for a specific archive folder. ```plist { actions = ( { type = moveMessage; mailbox = "${MM_LOCATION}"; } ); } ``` ```plist { actions = ( { type = moveMessage; mailbox = "/Archive/${MM_FOLDER}"; } ); } ``` -------------------------------- ### MailMate Action: Change Message Flags Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Example of an action-plist to change message flags. The 'enable' array specifies which flags to set. ```plist { actions = ( { type = changeFlags; enable = ( "Equivalent" ); } ); } ``` -------------------------------- ### Create a New MailMate Bundle Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Use the create_bundle script to generate a new bundle. Replace 'TestBundle', 'Your Name', and 'your_address@example.com' with your desired values. ```bash /Applications/MailMate.app/Contents/SharedSupport/bin/create_bundle TestBundle "Your Name" your_address@example.com ``` -------------------------------- ### Configure Key Equivalent Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Assign a keyboard shortcut to a command using the keyEquivalent keyword. ```text keyEquivalent = "^t"; ``` -------------------------------- ### Create Email with emate Source: https://context7.com/mailmate/mailmate_manual/llms.txt Use the 'emate' command-line tool to create and send emails. Specify recipients, subject, and body content via stdin. Attachments can be included by providing file paths. ```bash # Create a new email with subject, recipient, and body from stdin echo "The body of the message." | emate mailto \ --to "Info " \ --subject "The subject of the message." ``` ```bash # Create email with attachment echo "Please review the attached file." | emate mailto \ --to "recipient@example.com" \ --subject "File attached" \ ~/Desktop/document.pdf ``` ```bash # Create email with custom IMAP tag echo "Important message body." | emate mailto \ --to "team@example.com" \ --subject "Tagged message" \ --header "#flags: important" ``` ```bash # Create and send email immediately (no composer window) echo "Automated notification content." | emate mailto \ --to "alerts@example.com" \ --subject "System Alert" \ --send-now ``` ```bash # Create signed and encrypted email echo "Confidential information." | emate mailto \ --to "secure@example.com" \ --subject "Encrypted Message" \ --sign --encrypt --openpgp ``` -------------------------------- ### Configure Custom Key Bindings Source: https://context7.com/mailmate/mailmate_manual/llms.txt Define custom keystrokes and multi-stroke sequences in a plist file located in the MailMate Resources directory. ```plist // File: ~/Library/Application Support/MailMate/Resources/KeyBindings/Custom.plist // Gmail-style key bindings example { // Single key actions "c" = "newMessage:"; "r" = "reply:"; "a" = "replyAll:"; "f" = "forwardMessage:"; "s" = "toggleFlag:"; "e" = "archive:"; "#" = "deleteMessage:"; "u" = "markAsUnread:"; // Multi-stroke key bindings for navigation "g" = { "a" = ( "goToMailbox:", "ALL_MESSAGES" ); "i" = ( "goToMailbox:", "INBOX" ); "s" = ( "goToMailbox:", "SENT" ); "d" = ( "goToMailbox:", "DRAFTS" ); "l" = "goToMailbox:"; // Opens mailbox selection window }; // Tagging with multi-stroke bindings "t" = { "s" = ( "toggleTag:", "Special" ); "i" = ( "toggleTag:", "Important" ); "w" = ( "toggleTag:", "WaitingFor" ); }; // Set/remove tags explicitly "l" = { "s" = ( "setTag:", "Special" ); "S" = ( "removeTag:", "Special" ); }; // Move to specific mailbox "v" = { "a" = ( "moveToMailbox:", "archive" ); "p" = ( "moveToMailbox:", "/Projects" ); }; // Selection with filters "*" = { "a" = "selectAll:"; "n" = "deselectAll:"; "r" = ( "selectWithFilter:", "#flags.flag = '\\Seen'" ); "u" = ( "selectWithFilter:", "#flags.flag !=[x] '\\Seen'" ); "s" = ( "selectWithFilter:", "#flags.flag = '\\Flagged'" ); }; // Text snippet insertion (Shift+F1) "$\UF704" = ( "insertText:", "Thanks for trying out MailMate." ); // Select all from same sender and delete "^~d" = ( "selectWithFormatString:", "from.address = '${from.address}'", "moveToMailbox:", "trash" ); } ``` -------------------------------- ### Clone an Existing Bundle Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Clone an existing bundle repository to customize it. Ensure you are in the MailMate bundles directory. ```bash mkdir -p ~/Library/Application\ Support/MailMate/Bundles cd ~/Library/Application\ Support/MailMate/Bundles git clone https://github.com/mailmate/omnifocus.mmbundle.git ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Defines environment variables for bundle commands. Multiple variables can be separated by newlines. ```text environment = "DEBUG_ENABLED=1"; ``` ```text environment = 'MM_CONTENT_TYPE=${content-type.type:text} MM_CONTENT_SUBTYPE=${content-type.subtype:plain}'; ``` -------------------------------- ### Enable MailMate Command Debugging Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Enable additional command output for debugging by setting the `MmDebugCommands` user default to `YES`. Print debug information to `stderr` or a file. ```bash defaults write com.freron.MailMate MmDebugCommands -bool YES ``` -------------------------------- ### LDAP Server Configuration Source: https://context7.com/mailmate/mailmate_manual/llms.txt Configure LDAP servers for address autocompletion. Specify connection details like hostname, port, SSL requirements, and authentication credentials. ```plist { servers = ( { requireSSL = 0; hostname = "ldap.example.com"; port = 389; username = "cn=readonly,dc=example,dc=com"; searchBase = "ou=people,dc=example,dc=com"; searchScope = "subtree"; }, ); } ``` -------------------------------- ### Configure External Editor Launch on Tab Source: https://context7.com/mailmate/mailmate_manual/llms.txt Set up MailMate to launch specific external editors when a tab is activated in the composer window, using their respective bundle IDs. ```bash defaults write com.freron.MailMate MmBundleCommandLaunchedOnTab "46C1F8A8-A069-4E54-A427-30D45342674F" ``` ```bash defaults write com.freron.MailMate MmBundleCommandLaunchedOnTab "F71DDBD6-E868-418B-956D-2EA0208538DB" ``` ```bash defaults write com.freron.MailMate MmBundleCommandLaunchedOnTab "5A2D62AF-4725-492B-BFC6-DAB411D1AA86" ``` ```bash defaults write com.freron.MailMate MmBundleCommandLaunchedOnTab "2EF4C1A0-8FE2-11E3-BAA8-0800200C9A66" ``` -------------------------------- ### Command Configuration Keys Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Configuration keys used to define behavior and constraints for MailMate commands. ```APIDOC ## Command Configuration Keys ### Description Defines how commands are triggered and how they interact with message content. ### Configuration Keys - **conditions** (string) - Limits a command to apply only to specific messages using mailbox condition syntax (e.g., "list-unsubscribe exists"). - **inputFilesPattern** (string) - A regular expression used to select specific MIME parts of a message to be saved as temporary files. The script receives the file paths via the MM_FILES environment variable. - **saveForEditing** (boolean) - When set to 1, allows external editors to access the message currently being edited in the Composer. ``` -------------------------------- ### Basic mailto: URI from Terminal Source: https://context7.com/mailmate/mailmate_manual/llms.txt Opens a new email composition window in the default mail client using the standard mailto URI scheme. Ensure MailMate is set as the default handler if you want to use its features. ```bash # Basic mailto from Terminal open "mailto:me@example.com?subject=Test&body=Body%20text" ``` ```bash # Force MailMate as the handler open -a MailMate "mailto:recipient@example.com?subject=Meeting&body=Let's%20schedule%20a%20meeting" ``` -------------------------------- ### Bundle Info.plist Source: https://context7.com/mailmate/mailmate_manual/llms.txt Defines metadata for a MailMate bundle. Ensure the UUID is unique. ```plist { name = "My Custom Bundle"; description = "Custom commands for workflow automation"; uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; } ``` -------------------------------- ### Use emate with macOS Shortcuts Source: https://context7.com/mailmate/mailmate_manual/llms.txt Integrate MailMate's command-line tool `emate` with the macOS Shortcuts app to compose emails programmatically. ```bash ~/bin/emate mailto --to "recipient@example.com" --subject "From Shortcuts" ``` -------------------------------- ### MailMate Key Binding Selectors Source: https://context7.com/mailmate/mailmate_manual/llms.txt Use these selectors within custom key binding configuration files to map specific actions to keyboard shortcuts. ```text // Navigation nextMessage: // Move to next message previousMessage: // Move to previous message nextUnreadMessage: // Move to next unread goToMailbox: // Go to mailbox (with optional UUID) scrollPageDown: // Scroll page down scrollPageDownOrNextUnreadMessage: // Scroll or next unread // Message Actions newMessage: // Create new message reply: // Reply to sender replyAll: // Reply to all forwardMessage: // Forward message archive: // Move to archive deleteMessage: // Move to trash moveToMailbox: // Move to mailbox (with UUID) // Flags and Tags toggleFlag: // Toggle starred/flagged toggleReadState: // Toggle read/unread toggleTag: // Toggle IMAP keyword setTag: // Set IMAP keyword removeTag: // Remove IMAP keyword // Selection selectAll: // Select all messages deselectAll: // Deselect all selectWithFilter: // Select by filter query // Mailbox Actions newSmartMailbox: // Create smart mailbox markAllAsRead: // Mark all as read in mailbox synchronize: // Sync mailbox with server // Composer send: // Send message sendAndArchiveParent: // Send and archive replied message toggleMarkdown: // Enable/disable Markdown insertFormatString: // Insert text with format string ``` -------------------------------- ### Enable Yahoo UID Mismatch Workaround Source: https://github.com/mailmate/mailmate_manual/wiki/Yahoo Use this command to enable an experimental workaround for UID mismatch issues in MailMate. ```bash defaults write com.freron.MailMate MmYahooMismatchWorkaroundEnabled -bool YES ``` -------------------------------- ### Manage Hidden Preferences via Terminal Source: https://context7.com/mailmate/mailmate_manual/llms.txt Use the defaults command to read, write, or delete hidden MailMate configuration settings. ```bash # Read a hidden preference defaults read com.freron.MailMate MmDefaultBccHeader # Delete a hidden preference defaults delete com.freron.MailMate MmDefaultBccHeader # --- Visual Appearance --- # Limit displayed email addresses in headers view defaults write com.freron.MailMate MmHeadersViewMaximum -integer 10 # Increase dock icon counter font size defaults write com.freron.MailMate MmDockCounterFontSize -float 48.0 # Collapse quoted text beyond level 2 defaults write com.freron.MailMate MmShowQuotedTextLimit -integer 2 # Always show attachments at top of message defaults write com.freron.MailMate MmShowAttachmentsFirst -bool YES # Never display HTML (plain text only) defaults write com.freron.MailMate MmNeverDisplayHTML -bool YES # --- Composing --- # Add default BCC to all outgoing messages defaults write com.freron.MailMate MmDefaultBccHeader -string "archive@example.com" # Use sending address as BCC defaults write com.freron.MailMate MmDefaultBccHeader -string "<.sender.>" # Per-identity BCC mapping defaults write com.freron.MailMate MmDefaultBccHeader -dict \ "work@example.com" "work-archive@example.com" \ "personal@example.com" "personal-archive@example.com" # Custom reply attribution string defaults write com.freron.MailMate MmReplyWroteString -string 'On %e %b %Y, at %k:%M, ${from.name:${from.address}} wrote:' # Enable inline reply from notifications defaults write com.freron.MailMate MmNotificationInlineReply -bool YES # --- Sending --- # Delay all outgoing messages defaults write com.freron.MailMate MmSendMessageDelayEnabled -bool YES defaults write com.freron.MailMate MmSendMessageDelayString -string "3 minutes" # Warn about external recipients (regex pattern for internal) defaults write com.freron.MailMate MmInternalRecipients -string "@mycompany\\.com" # Store sent replies with original message defaults write com.freron.MailMate MmMoveSentRepliesToMailboxOfRepliedMessage -bool YES # --- Navigation --- # Configure message selection after move/delete # Values: none, next, previous, unreadOrNext, unreadOrPrevious defaults write com.freron.MailMate MmMessagesOutlineMoveStrategy -string "unreadOrNext" # Use specific browser for links defaults write com.freron.MailMate OakBrowserAppBundleIdentifier -string "com.google.Chrome" # --- IMAP --- # Launch in offline mode defaults write com.freron.MailMate MmInitialOfflineStateEnabled -bool YES # --- Debugging --- # Enable logging defaults write com.freron.MailMate LoggingEnabled -bool YES defaults write com.freron.MailMate MmDebugScripts -bool YES defaults write com.freron.MailMate MmDebugSecurity -bool YES ``` -------------------------------- ### Emulate MailMate Input for Script Testing Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Test scripts outside of MailMate by emulating input using `stdin` and environment variables. This allows for easier debugging of helper scripts. ```bash cat test_input.txt | MM_FROM_EMAIL=user@example.com Support/bin/helper ``` -------------------------------- ### Specify MIME Parts for Input Files Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles The `inputFilesPattern` key uses a regular expression to select specific MIME parts of a message to be saved as separate files. The script receives information about these files via the `MM_FILES` environment variable. ```regex ^text/plain$ ``` ```regex image/ ``` ```regex multipart/mixed image/ ``` -------------------------------- ### Set Execution Mode Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Determines how a command behaves when multiple messages are selected. ```text noMessages ``` ```text singleMessage ``` ```text multipleMessages ``` -------------------------------- ### mlmt: URI Scheme for Quick Search Source: https://context7.com/mailmate/mailmate_manual/llms.txt Triggers toolbar-style searches within MailMate using the 'mlmt:' URI scheme. Supports searching by header fields like subject ('s'), from ('f'), and to ('t'). ```bash # Search subject lines for "mlmt" open "mlmt:quicksearch?string=s%20mlmt" ``` ```bash # Search from addresses for "amazon" open "mlmt:quicksearch?string=f%20amazon" ``` ```bash # Search to addresses for "team" open "mlmt:quicksearch?string=t%20team" ``` ```bash # Combined search: subject contains "receipt", from contains "shop" open "mlmt:quicksearch?string=receipt%20f%20shop" ``` -------------------------------- ### Custom Pre-Send Verifications Source: https://context7.com/mailmate/mailmate_manual/llms.txt Define custom verifications that run before sending an email. These can check for missing tags, attachments mentioned in the body, or other conditions. ```plist { verifications = ( { title = "Message not tagged"; details = "You have not tagged the message. Are you sure you want to send it?"; conditions = "#flags !~ '@'"; }, { title = "Missing attachment?"; details = "You mentioned 'attached' but there's no attachment."; conditions = "#body-text ~ 'attached' AND #has-attachment = 0"; } ); } ``` -------------------------------- ### Generate and Copy UUID to Pasteboard Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Use this command in the Terminal to generate a new UUID and copy it to your clipboard for use in property list files. ```shell uuidgen | tr -d "\n" | pbcopy ``` -------------------------------- ### OpenPGP/S/MIME Key Mapping Source: https://context7.com/mailmate/mailmate_manual/llms.txt Map email addresses to PGP User IDs or S/MIME key serial numbers for automatic signing and encryption. Define patterns for enabling these features. ```plist { map = ( { address = "user@example.com"; userID = "0x70DC41A4D3A3CB12"; }, { address = "other@example.com"; serial = "34 29 1B DA 91 26 0A 8D"; }, ); signingEnabledPattern = "*@secure.example.com"; encryptionEnabledPattern = "*@private.example.org"; } ``` -------------------------------- ### Define Format Strings Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Generates output strings for messages using format specifiers, often used with the formatted input type. ```text formatString = "${from.address:unavailable}"; ``` ```bash sort -f | uniq -ic | sort --reverse --numeric-sort | head -10 ``` ```text formatString = "${from.name:No name available} ${subject.body:No subject available} "; ``` -------------------------------- ### Open Message by ID Source: https://context7.com/mailmate/mailmate_manual/llms.txt Opens a specific email message in MailMate using its unique Message-ID. ```bash # Open message by Message-ID open "message:" ``` -------------------------------- ### Set BusyContacts as Default Address Book Source: https://context7.com/mailmate/mailmate_manual/llms.txt Configure MailMate to use BusyContacts as its default address book using a `defaults` command. ```bash defaults write com.freron.MailMate MmDefaultAddressBook -string com.busymac.busycontacts ``` -------------------------------- ### Extended mailto: URI with Attachments and Auto-Send Source: https://context7.com/mailmate/mailmate_manual/llms.txt Utilizes MailMate's extended 'mailto:' URI scheme to include attachments and automatically send emails. Requires AppleScript with the 'with trust' option for security. ```bash # Create message with attachment and auto-send via AppleScript osascript -e 'tell application "MailMate" to open location "mailto:recipient@example.com?subject=Report&body=Please%20find%20attached&attachment-url=file:///Users/me/report.pdf&send-now=yes" with trust' ``` ```bash # Alternative AppleScript command (works with sandboxed apps) osascript -e 'tell application "MailMate" to open mailto "team@example.com?subject=Weekly%20Update&body=Status%20report%20attached&attachment-url=file:///path/to/status.pdf"' ``` -------------------------------- ### Filter and Theme Definitions Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Configuration for email content filters and visual themes. ```APIDOC ## Filters and Themes ### Filters - **input** (string) - Supported formats: 'canonical' and 'html'. - **output** (string) - Supported formats: 'canonical' and 'html'. ### Themes - **name** (string) - Display name for the theme in the UI. - **author** (string) - Name of the theme author. - **comment** (string) - Short description of the theme. - **css** (string) - The CSS stylesheet used for HTML generation. ``` -------------------------------- ### AppleScript Integration for MailMate Actions Source: https://context7.com/mailmate/mailmate_manual/llms.txt Execute various MailMate actions programmatically using AppleScript. This includes toggling flags, marking messages, moving messages, navigating mailboxes, and performing custom bundle commands. ```applescript -- Toggle flag on currently selected message tell application "MailMate" to perform {"toggleFlag:"} ``` ```applescript -- Mark selected messages as read tell application "MailMate" to perform {"markAsRead:"} ``` ```applescript -- Move selected messages to archive tell application "MailMate" to perform {"archive:"} ``` ```applescript -- Go to inbox mailbox tell application "MailMate" to perform {"goToMailbox:", "INBOX"} ``` ```applescript -- Toggle a custom tag tell application "MailMate" to perform {"toggleTag:", "Important"} ``` ```applescript -- Execute a bundle command by UUID (e.g., add to OmniFocus) tell application "MailMate" to perform {"performBundleItemWithUUID:", "03B35B47-9836-4EE1-9AFF-0D01D6F249F0"} ``` ```applescript -- Create new message tell application "MailMate" to perform {"newMessage:"} ``` ```applescript -- Reply to selected message tell application "MailMate" to perform {"reply:"} ``` -------------------------------- ### Limit Command to Specific Message Types Source: https://github.com/mailmate/mailmate_manual/wiki/Bundles Use the `conditions` key to restrict a command to apply only to messages matching specific criteria, such as the presence of a 'List-Unsubscribe' header. ```text conditions = "list-unsubscribe exists"; ``` -------------------------------- ### Tag By Subject Command Source: https://context7.com/mailmate/mailmate_manual/llms.txt A MailMate command that tags a single message as 'Urgent' if its subject contains '[urgent]'. It uses a Ruby script to generate the 'changeFlags' action. ```ruby #!/usr/bin/env ruby require "json" actions = { actions: [ { type: "changeFlags", enable: ["\\Flagged", "Urgent"] } ] } print JSON.dump(actions) ``` -------------------------------- ### Custom CSS for Message Display Source: https://context7.com/mailmate/mailmate_manual/llms.txt Apply custom CSS to the message viewing area to change font, size, and styling for blockquotes. This affects how emails are rendered within MailMate. ```css body { font-family: "SF Pro Text", -apple-system, sans-serif; font-size: 14px; line-height: 1.5; } blockquote { border-left: 2px solid #ccc; margin-left: 0; padding-left: 1em; color: #666; } @media print { body { font: 12pt "Courier"; } } ``` -------------------------------- ### Archive Old Messages Command Source: https://context7.com/mailmate/mailmate_manual/llms.txt A MailMate command to archive messages older than 30 days. It uses a bash script to process the received date and outputs a 'moveMessage' action. ```bash #!/bin/bash # Process dates and output actions cat <