• 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
Re: a date is not a date? Or: Why I sometimes hate AppleScript...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: a date is not a date? Or: Why I sometimes hate AppleScript...
      • From: KOENIG Yvan <email@hidden>
References: 
 >Re: a date is not a date? Or: Why I sometimes hate AppleScript... (From: "Gary (Lists)" <email@hidden>)

  • Prev by Date: Re: A date IS a date
  • Next by Date: Re: PHP and Applescript
  • Previous by thread: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Next by thread: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Index(es):
    • Date
    • Thread