Re: How to get every message that meets a condition in Mail
Re: How to get every message that meets a condition in Mail
- Subject: Re: How to get every message that meets a condition in Mail
- From: Christian Boyce <email@hidden>
- Date: Tue, 4 Nov 2003 00:32:45 -0800
On Nov 3, 2003, at 4:49 PM, kai wrote:
You'd probably be better off directly comparing date values,
Christian. This
works for me:
--=========================
set today to current date
set today's time to 0
tell application "Mail"
set theMessages to messages of mailbox "Sent Messages" of
account
"kai" whose date sent >= today
end tell
Wow. Nice.
Your "set today's time to 0" is something new to me. That will help me
down the road.
I had constructed something similar this evening, but not as elegantly:
set today to date string of (current date) as string
set midnight to "12:00:01 AM"
set today to (today & " " & midnight)
set today to date (today)
and then I compared dates in Mail as you did.
Setting the time to 0 is a lot nicer than doing what I did. Thanks a
lot.
In case anyone wonders what I'm up to with this it's really a handy
thing. My assistant takes phone calls for me all day long and sends
them as text messages to my phone. At the end of the day she runs a
script that gathers up all of the day's messages and creates a single
message with the title "Summary of Phone Calls for (date)." A copy is
sent to me and she gets one too. This was a little easier with Outlook
Express in OS 9. That one I did without help.
Now, if I could only figure out how to print a message based on a rule
in Mail. This also was easy in Outlook Express as it's an option within
the Rules dialog box. I should be able to script something like "print
message" but so far, no good.
Thanks again.
cb
--
Christian Boyce
Macintosh Consultant
310-452-3720
http://www.christianboyce.com
Free Mac consultations for firefighters through 12/31/2003.
Contact us for details.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.