[ Team LiB ] |
Chapter 19. DictionariesA dictionary is a scriptable application's way of letting the world know how it extends AppleScript's vocabulary. This extended vocabulary is called the application's terminology. AppleScript itself defines few commands, and has few abilities of its own; its value emerges when it is used for communicating, by means of Apple events, with scriptable applications. A scriptable application provides powers that AppleScript lacks, along with terminology that permits the programmer to harness those powers. For example, AppleScript can't make a new folder on your hard drive, but the Finder can; and the Finder supplements AppleScript's vocabulary with terms such as make and folder so that you can use AppleScript to command it (the Finder) to do so. This supplementary terminology is made available through the Finder's dictionary. A dictionary has two intended audiences:
This chapter discusses both aspects of dictionaries. It explains how AppleScript uses dictionaries. It also describes the dictionary as experienced by the programmer, who will use it to learn how to talk to an application. Studying a dictionary to figure out how to use AppleScript to get an application to do your bidding (and combining that study with experimentation when the dictionary is insufficiently informative) is a major part of the typical AppleScript programming experience. See Chapter 3 for an example. Certain details about how an application's dictionary is stored appear in Section 4.8. In Section 10.2 we talked about how AppleScript decides what application it will be sending Apple events to. In Section 12.3 and Section 12.4 we discussed how AppleScript decides what application's dictionary it will use to resolve terminology. |
[ Team LiB ] |