• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: scripting a task in mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scripting a task in mail


  • Subject: Re: scripting a task in mail
  • From: Christian Boyce via AppleScript-Users <email@hidden>
  • Date: Wed, 15 Jan 2020 08:25:54 -0800

This works— just click on an email to indicate which message you want to work
with, then run the script. You'll still have to click "Send" which is probably
a good safety factor.

It also works if you have double-clicked a message to open it up.

--
--      Created by: Christian Boyce
--      Created on: 1/15/20
--
--      Copyright (c) 2020 Christian Boyce and Associates
--      All Rights Reserved
--

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Mail"
        set theMessages to selection
        set myMessage to item 1 of theMessages
        set theSubject to "[neighbourhood watch] " & subject of myMessage
        set theBody to content of myMessage
        set aNewMessage to make new outgoing message with properties
{subject:theSubject, content:theBody}
        --
        tell aNewMessage
                make new to recipient at end of to recipients with properties
{address:"email@hidden"}
                make new bcc recipient at end of bcc recipients with properties
{address:"email@hidden"}
        end tell
end tell

> On Jan 15, 2020, at 6:49 AM, Rowland Carson via AppleScript-Users
> <email@hidden> wrote:
>
> I’ve made some simple scripts for BBEdit and GraphicConverter (mostly by
> recording actions and editing the result) but not for any other applications.
> I have a task in Apple Mail that comes up frequently; I forward messages from
> the local police to all those in the local Neighbourhood Watch group.
>
> What I’d like to be able to do in AppleScript is to forward the
> currently-selected message to my own address, and BCC it to the Contacts
> group Neighbourhood Watch. Before sending, I want to insert the text
> “[neighbourhood watch] ” at the beginning of the message subject line.
>
> Can anyone offer suggestions about how to construct such a script?
>
> And, yes, I know I could probably achieve a similar result by setting up a
> Google Group - but not all of the recipients would be happy with that
> approach.
>
> in friendship
>
> Rowland
>
> | Rowland Carson          ... that's Rowland with a 'w' ...
> | <email@hidden>            http://www.rowlandcarson.org.uk
> | Skype, Twitter: rowland_carson      Facebook: Rowland Carson
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden


--
Christian Boyce
Christian Boyce and Associates
Mac, iPhone, and iPad Consultants

For appointments, please call the office: 424-354-3548.
We do not make appointments by email or text. We're old-fashioned that way.

Read our latest blog post: ‌How to un-zoom (and re-zoom) your iPhone’s screen
<https://iphoneinaminute.com/how-to-un-zoom-and-re-zoom-your-iphones-screen/>‌

Join our mailing list! ‌https://confirmsubscription.com/h/d/15BCAA37978B70C5
<https://confirmsubscription.com/h/d/15BCAA37978B70C5>
Follow us on Twitter! http://twitter.com/christianboyce
<http://twitter.com/christianboyce>
Be a fan on Facebook! https://www.facebook.com/christianboyce.and.associates
<https://www.facebook.com/christianboyce.and.associates>

Current location and temperature:
‌‌‌
Santa Monica, United States: ☀️ +45°F
‌

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >scripting a task in mail (From: Rowland Carson via AppleScript-Users <email@hidden>)

  • Prev by Date: scripting a task in mail
  • Next by Date: Re: scripting a task in mail
  • Previous by thread: scripting a task in mail
  • Next by thread: Re: scripting a task in mail
  • Index(es):
    • Date
    • Thread