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: has <email@hidden>
- Date: Sat, 9 Feb 2008 17:49:21 +0000
On 9 Feb 2008, at 16:29, deivy petrescu wrote:
As people have already pointed out, this is a clash in nomenclatures.
iTunes defines year as a property of audio CD playlist.
[...]
As for you hating AS, this is your call, but mostly I feel that
problems arise because of the implementors.
Nope, its AppleScript's fault. Terminology conflicts are an inevitable
consequence of its design, and an object lesson in why it's a bad idea
to combine arbitrarily extensible grammar with dumb character-based
source code.
It's neither reasonable nor realistic to expect application developers
to know of, and avoid, every single keyword that might someday be used
by some other osax or AppleScript itself, and completely unfair to
blame them when such conflicts do occur.
These problems simply don't exist in languages that have a stable,
unambiguous grammar, e.g. the following works perfectly in Python with
nary a peep about invalid syntax or unknown properties or any of that
other cryptic nonsense that AppleScripters have to put up with:
from appscript import *
tracks = app('iTunes').browser_windows.first.selection()
for track in tracks:
date = track.date_added()
print type(date)
print date.year
The only terminology conflicts for which application developers might
reasonably take some responsibility are those that occur between
keywords in the application's own dictionary - e.g. if a class and a
property both have the same name, - although these sorts of limited
conflicts are still largely Apple's fault for creating the whole human-
readable names versus raw Apple event codes dichotomy in the first
place.
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
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