Re: a date is not a date? Or: Why I sometimes hate AppleScript...
Re: a date is not a date? Or: Why I sometimes hate AppleScript...
- Subject: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 09 Feb 2008 20:11:21 -0800
- Thread-topic: a date is not a date? Or: Why I sometimes hate AppleScript...
On 2/9/08 7:05 PM, "Gary (Lists)" <email@hidden> wrote:
> By your own description, there is no "guessing" what "year" means:
>
>> it [AppleScript]
>> makes a best-guess about the user's intent for that word according to
>> where it appears in the script: if it appears within the 'tell app
>> "iTunes"' block, it gives it one meaning; if it appears outside the
>> block it gives it another.
>
> Yes, precisely. Why is that guessing? I don't get it.
I agree. It's a rule. You just have to learn the rule.
If it's inconvenient to terminate the tell block to do this, you can just do
it in a handler, of course.
tell application "iTunes"
set theYear to my GetYear(date "Saturday, February 2, 2008 12:00:00 AM")
end tell
--> 2008
on GetYear(aDate)
return year of aDate
end GetYear
I agree with Yvan that the developers should have known better and named
their property 'year recorded' or something like that.
--
Paul Berkowitz
_______________________________________________
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