• 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: Applescript in El Capitan Mail rule processes the wrong message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript in El Capitan Mail rule processes the wrong message


  • Subject: Re: Applescript in El Capitan Mail rule processes the wrong message
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 19 Mar 2018 11:46:31 +1100

G’day Christian

I can suggest several things after 10 years of working with Mail.app and rules.

1.      I THINK rules are triggered as soon as mail arrives, but possibly
before they fully download. That’s an ‘Ouch’ factor. Answer, GUI trigger a
‘Rebuild’ menu item of Mail after a short delay (about 0.5 seconds), THEN
process the ‘last message’.

2.      Shift the last message to a separate mailbox via the rule, then trigger
the Applescript and process the shifted message(s), (this is what I’ve learned
to do), again with a ‘Rebuild’.

Hope this helps.

Regards

Santa

> On 19 Mar 2018, at 11:32 am, Christian Boyce <email@hidden>
> wrote:
>
> I have a problem with a Mail rule in El Capitan. The rule has an AppleScript
> step (at the end) which does a few things with the content of the incoming
> message. I know the script is fine and I know also the triggering is fine.
> And, this all worked great for a long time on a Mac with 10.7.5. But in El
> Capitan, the AppleScript does not get the content of the received message—
> instead, it gets the content of some other message. I think it's the message
> that was received just before the message I want but I am not sure about that.
>
> Here's the strange part. If a message exists in Mail, and I select it and
> choose Message/Apply Inbox Rules (by hand), the message I've selected is
> processed and my script knows which message to work with. But when the
> message comes in and the rule is triggered automatically, the Rule gets the
> content of the message before it in the message list.
>
> If I throw away all existing messages that would match the Rule's trigger,
> leaving me with a blank Inbox, and then I send myself another message that
> matches the Rule's trigger, the AppleScript STILL works on the wrong message—
> something that's in the trash. It's nutty.
>
> I've read about Mail Rules in El Capitan being buggy with respect to
> AppleScript but there has to be a way to make it work. My rule is definitely
> trapping the right message as I can see that it's changing the message's text
> color, and marking it as "read." But then the AppleScript part, which is the
> last step, uses the content of a different message.
>
> Any suggestions? I sure could use some!
> _______________________________________________
> 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

 _______________________________________________
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: 
 >Applescript in El Capitan Mail rule processes the wrong message (From: Christian Boyce <email@hidden>)

  • Prev by Date: Applescript in El Capitan Mail rule processes the wrong message
  • Next by Date: Re: Reading Calendar events - need comments/suggestions
  • Previous by thread: Applescript in El Capitan Mail rule processes the wrong message
  • Next by thread: Re: Applescript in El Capitan Mail rule processes the wrong message
  • Index(es):
    • Date
    • Thread