• 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
Setting the Subject Field in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting the Subject Field in Mail


  • Subject: Setting the Subject Field in Mail
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 29 Dec 2015 17:04:35 -0600

Hey Folks,

I send a moderate amount of off-list email, and I want the reader to KNOW it's off-list – so I use a subject prefix:

“[ OFFLIST ]”

I used to use:

“[OFFLIST]”

But people often tend to ignore bracketed text in the subject, and I found the addition of the spaces was more attention-grabbing.

I normally use Typinator to emplace this, and I occasionally forget to change the outgoing address.

It irritates the snot out of me when I goof and send an [ OFFLIST ] message TO the list it WASN'T supposed to go to.

Back in the better scripting days of Eudora I had a very sophisticated script to manage this sort of thing, but I gave up on trying to emulate such things with Mail for obvious reasons.

However – since System Events is faster and better these days I see no reason to avoid using it any more – and I'm slowly implementing functions I used to take for granted.

Here's a simple example of setting the subject of an outgoing message:

--------------------------------------------------------
tell application "System Events"
  tell application process "Mail"
    tell (first window whose subrole is "AXStandardWindow")
      if value of static text 2 = "Subject:" then
        tell text field 2
          set msgSubject to its value
          set msgSubject to "[ OFFLIST ] " & msgSubject
          set its value to msgSubject
        end tell
      end if
    end tell
  end tell
end tell
--------------------------------------------------------

I'll add bits to make it throw an error if any recipient is one of my email lists or forums, and that will put PAID to this particular problem.

--
Best Regards,
Chris

 _______________________________________________
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

  • Prev by Date: Re: AppleScript and shell scripting
  • Next by Date: Mail attachments
  • Previous by thread: Re: Apple Configurator 2 (was Re: El Capitan)
  • Next by thread: Mail attachments
  • Index(es):
    • Date
    • Thread