Re: trouble with weekday names
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