Multiple-Word Terms
Many terms, especially commands in scripting additions, consist of multiple words
. An example frequently used in this book is display dialog. You might think that such a term would present extra challenges for resolution, but in actual fact just the opposite appears to be the case; multiple-word
terms are a good thing:
- You can't make one
Terms that you create in a script can't contain spaces unless surrounded by pipes—and pipes mean that no dictionary will be consulted. Therefore the probability of your creating a term in a script that clashes with a dictionary-based multiple-word term is zero.
- Clash is improbable
The more words a term consists of, the more likely it is that this term is unique among all dictionaries. This is especially important with scripting additions, whose terms are globally visible; for this reason, well-behaved scripting additions tend to use multiple-word commands.
- There is no clash with single-word terms
This is the really surprising part. Consider, for example, the scripting addition command
set the clipboard to. Even thoughset...tois a command, andtheis usually ignored, andclipboardcould be a variable name (and is in fact a property defined by AppleScript), no confusion arises:local clipboard, tester set clipboard to "Mannie" -- sets the variable clipboard set the tester to "Moe" -- sets the variable tester (ignoring "the") set the clipboard to "Jack" --sets the system scrap
Though I don't know the details, a natural explanation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access