https://support.apple.com/guide/mail/use-scripts-as-rule-actions-mlhlp1171/mac [ ] * Global Nav Open MenuGlobal Nav Close Menu * Apple * Shopping Bag+ Search Support Cancel * Apple * Store * Mac * iPad * iPhone * Watch * AirPods * TV & Home * Only on Apple * Accessories * Support * * Shopping Bag+ [ ] Cancel [ ] Mail User Guide Open Menu Close Menu * Communities * Contact Support macOS Ventura 13 macOS Monterey 12 macOS Big Sur 11.0 macOS Catalina 10.15 macOS Mojave 10.14 macOS High Sierra Select version: [macOS Ventura 13 ] Modifying this control will update this page automatically Search this guide [ ] Clear Search Table of Contents Mail User Guide * Welcome * What's new in Mail * Manage email accounts + Add email accounts + Use a custom email domain + Log out of or temporarily turn off an email account + Log out of or remove email accounts * Send email + Write, send, and schedule emails + Unsend emails with Undo Send + Address emails + Format text in emails + Add attachments to emails + Mark up email attachments + Create and use email signatures + Reply to, forward, or follow up on emails + Use Remind Me to come back to emails later + Redirect emails * Receive email + Read emails + View email conversations + View, save, or delete email attachments + Mute conversations + Block or unblock senders + Unsubscribe from mailing lists + Reduce junk mail + Manage notifications + Use Focus filters + Use information found in Mail in other apps + Delete emails + Print emails * Find email + Search for emails + Filter emails + Sort emails + Flag emails + Show emails from VIP senders * Organize email in mailboxes + Move or copy emails + Create or delete mailboxes + Use favorite mailboxes + Use Smart Mailboxes + Archive emails + Move or copy mailboxes + Import or export mailboxes * Customize Mail + Change settings + Use Mail Privacy Protection + Use Hide My Email + Use Mail extensions + Use column layout + Show people's pictures + Use tabs + Use Mail full screen + Use rules to manage emails you receive + Automate Mail tasks + Sign or encrypt emails * Keyboard shortcuts * Troubleshooting * Copyright # Use scripts as rule actions in Mail on Mac You can attach an AppleScript script to a Mail rule. For example, you could have an incoming message trigger a script that copies information from the message and pastes it into a database that works with Script Editor. Open Mail for me 1. In the Mail app # on your Mac, choose Mail > Settings, then click Rules. 2. Select an existing rule, then click Edit, or click Add Rule to create a rule. 3. Click the "Perform the following actions" pop-up menu, then choose Run AppleScript. 4. From the pop-up menu, choose a script located in ~/Library/ Application Scripts/com.apple.mail, or choose "Open in Finder" to open the folder so you can copy a script into it. If you later move or rename the script, your rule will not work. 5. Click OK to save the rule. If you use iCloud Drive, your rules are available on your other Mac computers that have iCloud Drive turned on and Mail selected in iCloud Drive options. Scripts attached to rules aren't available. See Use iCloud Drive to store documents. See alsoAutomate tasks in Mail on MacBlock or unblock senders in Mail on Mac Helpful? Yes No [ ] Character limit: 250 Please don't include any personal information in your comment. Maximum character limit is 250. Submit Thanks for your feedback. Apple Footer Apple 1. Support 2. Mail User Guide 3. Use scripts as rule actions in Mail on Mac United States Copyright (c) 2022 Apple Inc. All rights reserved. Privacy Policy Terms of Use Sales and Refunds Site Map