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: KOENIG Yvan <email@hidden>
- Date: Sat, 9 Feb 2008 16:20:45 +0100
Le 9 févr. 2008 à 14:57, Skeeve a écrit :
tell application "iTunes"
set these_tracks to selection of front browser window
set these_tracks_ref to a reference to these_tracks
repeat with tr in these_tracks_ref
set y to date added of tr
tell application "System Events"
display dialog class of y
display dialog year of y
end tell
end repeat
end tell
It appears that iTunes is able to extract the date information linked
to a track but is unable to work with it.
So, just stop speaking to iTunes, the Standard Additions will do
their job.
To do that you may encapsulate the date related instructions in a
tell to something else (you choose System Events but I'm sure that
other ones would have did the same trick)
You may put the date related instructions in a handler. It's what I
often does.
tell application "iTunes"
set these_tracks to selection of front browser window
set these_tracks_ref to a reference to these_tracks
repeat with tr in these_tracks_ref
set y to date added of tr
my treatDate(y)
end repeat
end tell
on treatDate(d)
display dialog class of d
display dialog year of d
end treatDate
An alternate track would be:
tell application "iTunes"
set these_tracks to selection of front browser window
set these_tracks_ref to a reference to these_tracks
end tell
repeat with tr in these_tracks_ref
tell application "iTunes" to set y to date added of tr
(* here we are not speaking to iTunes *)
display dialog class of y
display dialog year of y
end repeat
Yvan KOENIG _______________________________________________
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