AppleScript Notes
Some notes that JavaScript? or Java programmers might find useful when comprehending AppleScript?.
Many of the concepts below are covered in greater detail and depth by Bill Briggs on MacCentral?. http://maccentral.macworld.com/columns/briggs.shtml
Object References
Most languages use this syntax: parent.child.child.method(), with the root object on the left. AppleScript? flips this around, with syntax that looks like method() of child of child of parent. There is only a containment hierarchy; there's no class inheritance hierarchy. So, you don't need VisualBasic? style addressing.
User Defined Objects
The basic object in Applescript is the "script". Thus, this syntax will allow you to create an object definition:
script Name
-- code goes here
end script
This creates a "script object", which is similar to a Class in most languages. The difference is that there are no classes in AppleScript?. Rather, you take this script object an copy it into a reference, like this:
copy Name into foo
At this point, there's foo, a Name object, and Name itself, which is an object. This seems a little weird, but it's a valid style of object definition and creation. (Yes, you can modify Name and then copy it, but that's not good practice.)
Who gets what message
This isn't an issue in JavaScript?, because all messages are sent to first to the script, and then the interpreter. The methods that make up JavaScript? are packaged into classes like Math, String, and Array. Math.abs(), for example.
In AppleScript?, the language is extended via "AppleScript? Additions". Each extension defines new keywords, which may clash with each other. There's no real solution for this, except to undersand the order of passing an ambiguous message past different handlers. This is detailed well by Briggs.
Associative Arrays
These don't really exist in AppleScript?. There's a type called a record, which works a little bit like an array:
set props to { name : "john", size : "XL" }
size of props
-- "XL"
The only problem is that there is not command to convert from records to arrays, and there's no way to read or write records to disk. Also, you can't just define a new key-value pair in the record and append it to the list.

