Re "Nouns" and "Verbs"
Re "Nouns" and "Verbs"
- Subject: Re "Nouns" and "Verbs"
- From: Marion Dickten <email@hidden>
- Date: Thu, 16 Jan 2014 10:28:32 +0100
Hello all,
This is not a question but rather a request to all people in the list who occasionally teach other people how to use AppleScript.
I've scratched my head a long time over this issue, and after reading the thread "Save as a web archive" I can see that other people also have the problem I have seen.
Some years ago I taught a two-day course on AppleScript. The first day focused on AppleScript itself, the second day went into AppleScripting QuarkXPress and InDesign.
The participants had been using AppleScript for a long time, scripting DTP applications by trial and error, and felt a strong need to have a systematic introduction.
After the first day one of the participants came up to me and said: "Wow, we finally understood AppleScript! We all used a book to teach ourselves so far and it was all so confusing-- those nouns and verbs and things, and it simply doesn't add up." Then *I* was confused, because I had never seen "nouns" and "verbs" except in Dictionaries (where they never helped, so I disregarded them completely). So the man told me that in the book they used the whole of AppleScript was explained in terms of nouns and verbs, and they found that a very complicated approach.
The approach I used without thinking even once about it was the approach suggested by Matt Neuburg in his Definitive Guide. It boils down to three rules.
1. Practically everything is an object. (The word "object", after all, means something like "thing", so this makes sense.) Examples are "document"s, "file"s, "disk"s, "window"s, you name it.
2. Objects can take certain messages and do something then. You tell an object to do something by saying "tell". (Easy.) In order to enable the object to understand the message, you need to supply all necessary information. This information consists of objects (see rule 1), and is called "Parameters". They may be included in brackets or marked as such by certain keywords, such as "as" or "in". These keywords are sometimes called "prepositions" (because that's what they are, they are written in front of the info supplied).
3. Objects may contain (or own, depending on how you want to think of it) other objects. A "document", for instance, contains "pages". (Easy.) If you want to send a message to an object contained in another object, you address the inner object by saying "of" (or "'s"). For instance, you say "page 1 of document 1".
When you have digested those three rules, AppleScript is, in my experience at least, fully understandable. All ramifications of AppleScript arise out of these rules.
The problem about the "noun" and "verb" metaphor is that both words are used in everyday language and are used in AppleScript to mean some aspects specific to the programming language *not* identical with the everyday meaning. This is the core of the problem. It is much better to avoid that metaphor altogether since it makes comprehension more difficult than the use of the object-message-metaphor which is more suitable to programming. AppleScript's origins were the ambitious idea to write a programming language working exactly like a natural language, and that has failed. This, in my opinion, should have been admitted, and the inadequate metaphor should have been completely dropped at least a decade ago.
Alex Zavatone in his post about "Save as a web archive" writes that he thought "as" is a "verb". He never thought "as" is a verb, of course. He was speaking about AppleScript classification of keywords, and his sentence is a perfect example of the confusion that classification causes. It simply doesn't fit.
Marion
_______________________________________________
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