Re: Specific Date-Time Formatting
Re: Specific Date-Time Formatting
- Subject: Re: Specific Date-Time Formatting
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 4 Nov 2005 15:59:15 -0500
On 11/4/05,
Paul Berkowitz <
email@hidden> wrote:
On 11/4/05 12:36 PM, "Christopher Nebel" <email@hidden> wrote:
>> Comment/question for Chris Nebel (or anyone else who can answer):
>> why does "month" require "its" but day doesn't require "its"?
>> (Even without "as integer", "month" requires "its"; without "its"
>> it returns "month" as a key word, but with "its", it returns the
>> name of the month.)
>
> It's an ambiguity in the grammar, and AppleScript tends to resolve it
> in the way people don't want. "month" is both a class and a property
> in that context; AppleScript assumes it's a class. To make it
> syntactically clear that it's a property, you have to add the "its".
Ah, yes, whereas 'day' is _only_ a property (of date). The 'class' (if
that's what it is - I thought it was a constant - same thing?) is 'days',
not 'day', so no confusion.
No, those constants are just that - constants, not classes. There
is no month(s) constant, because months aren't all the same
length.
(That's why you have to write the ungrammatical
(1 * days) when you need 1 day in seconds.)
Or just "days" without the 1 *.
I'm guessing "month" is a class the same way "date" is a class. But you
can't construct month objects using the keyword, so I'm not sure what
its utility is. All of the following result in an error, either
"NSCannotCreateScriptCommandError" or "Can't make blah into a month":
month "January"
month January
month 1
"January" as month
January as month
1 as month
--
Mark J. Reed <
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:
This email sent to email@hidden