• 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: Clint Hoxie <email@hidden>
  • Date: Mon, 17 Dec 2007 14:30:21 -0700

Ed,

That was the reply I was wanting. Thanks for explaining it. Someday I'll have figured out all the data types...maybe.

Clint

PS - What is HTH? "Honour Thy Horse"?



On Dec 17, 2007, at 2:14 PM, Stockly, Ed wrote:

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 (applescript- 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
  • Follow-Ups:
    • Re: trouble with weekday names
      • From: "Stockly, Ed" <email@hidden>
    • Re: trouble with weekday names
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: trouble with weekday names (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: trouble with weekday names
  • Next by Date: Parsing Strings
  • Previous by thread: Re: trouble with weekday names
  • Next by thread: Re: trouble with weekday names
  • Index(es):
    • Date
    • Thread