[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apple English

> Apple Script seems goofy to me because it reads like English but has 
> extra words I don't expect as a programmer.  I cut and paste Apple 
> Script code to make sure I get the syntax right.  It reads like 
> English, but it's not what I would have written.  For example:
>    tell app "Terminal"
>      set custom title of first window to "XYZ - something.foo.com"
> If I'd written this myself, I would have left out "custom" and "of 
> first window."
> Geoffrey
> --
> Geoffrey S. Knauth | http://knauth.org/gsk


    I think the problem with AppleScript is how it simulates natural language.
    Under the hood it is treating multiword phrases as identifiers and operators, so the words "custom title" are really seen as a single symbol internally and a phrase like "is not contained by" is seen as a single operator.

    When you write new pseudo-english functions in AppleScript, you are stuck with a fixed grammar and need to fit your use of language into one of the calling patterns built into AppleScript.

    "Of first window" gets added to your script because it provides the context in which "cutom title" can be found in the presence of anaphora (ie. your omitting the object whose "custom title" you wished to set. 

    There is no theorectical reason why your original syntax couldn't have been preserved and correlated with its normalized cannonical representation. I'm sure the PLT Scheme crew could handle this with ease. So I would say this annoyance is more a question of implementation choices at Apple than a deficiency of natural language based notations per se.

Warmest Regards,



Peter J. Wasilko, Esq.
     J.D., LL.M.               

Executive Director, The Institute for End User Computing, Inc.

Visit us on the web at: http://www.ieuc.org


Its time to abandon brittle architectures with poorly factored
interfaces, gratuitous complexity, and kludged designs dominated
by sacrifices on the altar of backwards compatibility.

Such artifacts are vulnerable to cyber-attack, weigh down the
economy costing trillions of dollars in lost productivity, and
suffer from an impoverished conceptual model that lacks the
integration and elegance needed to empower end users to
get the most from advanced applications in the future.

The Institute for End User Computing --- Pursuing Secure, Simple, 
   Supple, & Sophisticated Systems to Unlock Our Human Potential

* The Institute is incorporated under New York State's
   Not-For-Profit Corporation Law