Re: iTunes doesn't handle dates well
Re: iTunes doesn't handle dates well
- Subject: Re: iTunes doesn't handle dates well
- From: Axel Luttgens <email@hidden>
- Date: Wed, 13 Dec 2006 12:31:58 +0100
On 13/12/06 6:33, David Richmond wrote:
Here's the script:
---
tell application
"iTunes"
set t to current date
log year of t
end tell
[...]
and here's the log
output:
---
tell application
"iTunes"
current date
date "Tuesday,
December 12, 2006 7:16:14 PM"
(*year*)
end tell
[...]
the line (*year*)
should read (*2006*)
when I try telling a
different app, like Safari, it has no problem
when try extracting
a different component of the date, like month, it has no problem
Note that "year" is a property defined by iTunes for "audio CD
playlist"s and for "track"s.
On the other hand Safari, for example, doesn't define such a property
and thus doesn't encounter any ambiguity.
Why does iTunes choke on the year of a date?
Is this just a bug?
More exactly, the log command tends to hide the error condition, by
just returning the name of the offending property.
Try this script instead:
tell application "iTunes"
set t to current date
year of t
end tell
and you'll get a well-behaved error. :-)
HTH,
Axel
|
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden