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

  1. Open Automator (you can find it in Applications/Utilities or use Spotlight to search for it).
  2. Choose "Service" as the type of document you want to create.
  3. Click "Choose" to create the service.

Step 2: Set up the service

  1. In the Automator window, select "Utilities" from the left-hand menu.
  2. Drag the "Run AppleScript" action from the library to the workflow area.
  3. Double-click the "Run AppleScript" action to open the script editor.
  4. 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

  1. Save the service as "Bounce Message" (or any other name you prefer).
  2. Choose a location to save the service, such as your Desktop or Applications folder.

Step 4: Add the service to the Services menu

  1. Go to System Preferences > Keyboard > Shortcuts > Services.
  2. Click the "+" button at the bottom left corner of the window.
  3. Select the "Bounce Message" service from the list.
  4. Click "Add" to add the service to the Services menu.

Step 5: Test the service

  1. Open Apple Mail and select a message.
  2. Go to the Services menu and select "Bounce Message".
  3. 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.