Automator service for bouncing message in apple mail
A great question!
To create an Automator service for bouncing a message in Apple Mail, you'll need to follow these steps:
Step 1: Create a new Automator service
- Open Automator (you can find it in Applications/Utilities or use Spotlight to search for it).
- Choose "Service" as the type of document you want to create.
- Click "Choose" to create the service.
Step 2: Set up the service
- In the Automator window, select "Utilities" from the left-hand menu.
- Drag the "Run AppleScript" action from the library to the workflow area.
- Double-click the "Run AppleScript" action to open the script editor.
- In the script editor, paste the following code:
tell application "Mail" set theMessage to (get the selection) if theMessage is not {} then set theSubject to subject of theMessage set theBody to body of theMessage set theFrom to from of theMessage set theTo to to of theMessage set theCC to cc of theMessage set theBCC to bcc of theMessage set theAttachments to attachments of theMessage tell application "System Events" tell process "Mail" set theWindow to window 1 set theMessageField to text field 1 of theWindow set theMessageField's value to theSubject set theBodyField to text area 1 of theWindow set theBodyField's value to theBody set theFromField to text field 2 of theWindow set theFromField's value to theFrom set theToField to text field 3 of theWindow set theToField's value to theTo set theCCField to text field 4 of theWindow set theCCField's value to theCC set theBCCField to text field 5 of theWindow set theBCCField's value to theBCC set theAttachmentsField to list 1 of theWindow repeat with i from 1 to count of theAttachments set theAttachment to item i of theAttachments set theAttachmentsField's value to theAttachmentsField's value & theAttachment & return end repeat end tell end tell end if end tell
This script will bounce the selected message in Apple Mail.
Step 3: Save the service
- Save the service as "Bounce Message" (or any other name you prefer).
- Choose a location to save the service, such as your Desktop or Applications folder.
Step 4: Add the service to the Services menu
- Go to System Preferences > Keyboard > Shortcuts > Services.
- Click the "+" button at the bottom left corner of the window.
- Select the "Bounce Message" service from the list.
- Click "Add" to add the service to the Services menu.
Step 5: Test the service
- Open Apple Mail and select a message.
- Go to the Services menu and select "Bounce Message".
- The message should be bounced, and the script should run successfully.
That's it! You now have a custom Automator service for bouncing a message in Apple Mail.