• 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: Dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dates


  • Subject: Re: Dates
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 03 Jan 2008 11:59:17 +0100

On 3/01/08 7:56, Michael wrote:

Michelle,

Can you figure why this is not working?

tell application "Mail"
set msgs to every message of (mailbox "INBOX" of account "comcast") whose (message id is "email@hidden") and (date sent is "Wednesday, January 2, 2008 3:22:23 PM")
--set sentDate to date sent of firstMsg (gives : "Wednesday, January 2, 2008 3:22:23 PM")
end tell


gives {}


Hello Michael,

Just reading above code, it looks like the problem must be with:

   (date sent is "Wednesday,  January 2, 2008 3:22:23 PM")

Property 'date sent' is of class date, while "Wednesday, January 2, 2008 3:22:23 PM" is a string.
The equality operator (i.e. the 'is' operator) always first checks the classes of its operands: if their classes are not the same, the operands are always considered as non equal.
As a result, your whose clause always evaluates to false.


Could you try with

   (date sent is date "Wednesday,  January 2, 2008 3:22:23 PM")

so that the second operand is of class date too?

HTH,
Axel
_______________________________________________
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: Dates
      • From: Michael <email@hidden>
References: 
 >Dates (From: Michael <email@hidden>)
 >Re: Dates (From: Michelle Steiner <email@hidden>)
 >Re: Dates (From: Michael <email@hidden>)

  • Prev by Date: How can I round in applescript to 3 digits after a period?
  • Next by Date: Re: How can I round in applescript to 3 digits after a period?
  • Previous by thread: Re: Dates
  • Next by thread: Re: Dates
  • Index(es):
    • Date
    • Thread