• 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: trouble with weekday names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trouble with weekday names


  • Subject: Re: trouble with weekday names
  • From: "Stockly, Ed" <email@hidden>
  • Date: Mon, 17 Dec 2007 13:14:57 -0800
  • Thread-topic: trouble with weekday names

You've gotten a few solutions, but here's a few details to explain why your
script behaves this way...


set DayIndicator to weekday of (current date)

Weekday is a property of date it can be coerced into String, text, unicode
text, integer but it is not text

display dialog DayIndicator
--The display dialog scripting addition displays the "AEprint" format of the
value passed to it. In this case that a three-character lower case string.
Also behaves the same way with the Month class

--remove the quotes and it works because Apple script recognizes Monday as
the data type for weekday.

if DayIndicator = Monday then
    set DayIndicator to "Today"
end if

-- it doesn't work with the quotes because you're comparing a string
"Monday" to a different data type. Coerce weekday to a string and it works.

if DayIndicator as string = "Monday" then
    set DayIndicator to "Today"
end if

HTH,

ES

 _______________________________________________
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: trouble with weekday names
      • From: Clint Hoxie <email@hidden>
  • Prev by Date: Re: question on accessing a list of websites
  • Next by Date: Re: trouble with weekday names
  • Previous by thread: Re: trouble with weekday names
  • Next by thread: Re: trouble with weekday names
  • Index(es):
    • Date
    • Thread