• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
a date is not a date? Or: Why I sometimes hate AppleScript...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a date is not a date? Or: Why I sometimes hate AppleScript...


  • Subject: a date is not a date? Or: Why I sometimes hate AppleScript...
  • From: Skeeve <email@hidden>
  • Date: Sat, 09 Feb 2008 14:57:20 +0100

I needed almost half an hour before I found a working solution but still don't know:
a) Why I need this construct
b) How one should have known


I tried this:
set x to current date
display dialog class of x
display dialog year of x

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
       display dialog class of y
       display dialog year of y
   end repeat
end tell


"year of x" works "year of y" fails

I really needed almost half an hour to find that this works:

set x to current date
display dialog class of x
display dialog year of x

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
_______________________________________________
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
  • Follow-Ups:
    • Re: a date is not a date? Or: Why I sometimes hate AppleScript...
      • From: deivy petrescu <email@hidden>
    • Re: a date is not a date? Or: Why I sometimes hate AppleScript...
      • From: KOENIG Yvan <email@hidden>
    • PHP and Applescript
      • From: Grace Finn <email@hidden>
    • Re: a date is not a date? Or: Why I sometimes hate AppleScript...
      • From: Kurt Klamp <email@hidden>
  • Prev by Date: Re: Error -609
  • Next by Date: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Previous by thread: Re: Error -609
  • Next by thread: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Index(es):
    • Date
    • Thread