• 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 a date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A date IS a date


  • Subject: Re: A date IS a date
  • From: Ed Stockly <email@hidden>
  • Date: Sat, 9 Feb 2008 19:08:40 -0800

>>Has>>>[1] Since AppleScript is a weakly, dynamically typed language, the only time it can know for sure what 'year' (as in 'year of <something>') means is when it actually applies it to an object at runtime. However, in order to create its English-like appearance, it 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. If it guesses wrong, the script fails at  runtime.


All this is sort of true, but most of it applies only when there is a terminology conflict, which is remarkably rare, even without the watchful eye of the apple event registrar.

I say sort of because it's not really a guess. When the compiler interprets a command inside a tell, it starts looking in the application dictionary, and if it finds a match it compiles and does not go on to the next level. So it's not really guess work, it makes an assumption, it consistently makes the same assumption, and  if there is a conflict, the compiler never really knows because it stops looking as soon as it hits a match. 

In most cases, this is kind of cool. If you're going to make a new folder in Finder or a box in Quark or a message in mail, you type the same keyword and depending on what tell block you're in the compiler figures out the command you want. But the scripter is in control, if you want to make a new Quark text box you wouldn't put the command inside a finder tell.

And how many terminology conflicts are out there, anyway?

It's like making cooking for six before you've even sent out the dinner invitations and have no actual idea if two, five or ten people will be coming.


How about this, a terminology conflict is like making dinner for six, and eight people show up, so two people go hungry.  After a while you'll remember that whenever you invite your boss he always brings a couple guests and you'll plan accordingly.


ES
=
 _______________________________________________
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 a date
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: PHP and Applescript
  • Next by Date: Re: A date IS a date
  • Previous by thread: Re: A date IS a date
  • Next by thread: Re: A date IS a date
  • Index(es):
    • Date
    • Thread