• 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: setting message to unread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting message to unread


  • Subject: Re: setting message to unread
  • From: Yvan KOENIG <email@hidden>
  • Date: Sat, 24 Oct 2015 16:32:00 +0200


Le 2015/10/24 à 14:27, 2551 <email@hidden> a écrit :

Hmm, more Mail mysteries. Wonder if anyone can throw some light on this.

I’ve got a mail rule that calls a numbers spreadsheet and updates it with info from the incoming message. Works just fine. Except…I also want the message to be marked as unread after the spreadsheet has been successfully updated.

I’ve tried two approaches:

1. In the rule, add the condition ‘mark as read’.
Problem: even though I add this condition after the ‘Run AppleScript’ action, it always moves to before it. The result of this is the message gets marked as unread, but my script doesn’t get called any my numbers sheet doesn’t update.

So instead, I tried

2. In the applescript, add the line

 set read status of theMessages to true

just before the end of the "perform action…" handler.
Problem: now the numbers sheet updates, but the message remains as unread.

Any ideas how do I get *both* of these to work together? Where can I put the ‘set read status..' line to make it work?

The whole mail handler looks like this (with some creative substitutions for public posting):

using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"


--get customer name from msg content
set this_item to item 1 of theMessages
set theTxt to this_item's content

…
my letsDoNumbers(theSource, theCustard, theEmail)
— everything works OK up to this point, however...

—this doesn’t work:
set read status of theMessages to true
end if
end tell

—putting it here instead doesn’t work either:
#set read status of theMessages to true
end perform mail action with messages
end using terms from


If I read well, theMessages  is a list whose first item - a message - is this_item
So I wonder if editing your instruction :     
set read status of theMessages to true
as
set read status of this_item to true
would solve the problem.


Yvan KOENIG running El Capitan 10.11.1 in French (VALLAURIS, France) samedi 24 octobre 2015 16:31:20



 _______________________________________________
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

  • Follow-Ups:
    • Re: setting message to unread
      • From: 2551 <email@hidden>
References: 
 >setting message to unread (From: 2551 <email@hidden>)

  • Prev by Date: Re: setting message to unread
  • Next by Date: Re: setting message to unread
  • Previous by thread: Re: setting message to unread
  • Next by thread: Re: setting message to unread
  • Index(es):
    • Date
    • Thread