6.3. Summary

A lot has been covered in this chapter. Lists and records are the two fundamental data structures for collecting data that are built into AppleScript. Knowing how to define and manipulate these data structures is a key component of becoming proficient with the AppleScript language.

In particular, you learned the following in this chapter:

  • That a list is an ordered collection of values called items.

  • How to access single and multiple items in a list and how to insert items into and delete items from a list.

  • How you can use the concatenation operator (&) to merge two lists together.

  • How to work with lists of lists and how you can use the choose from list command to present the user with a list of choices from which to choose.

  • How to use containment operators to see if one or more items are contained in a list.

  • That a record is an unordered collection of values, called properties. A property consists of a name and a corresponding value.

  • That unlike lists, you cannot refer to the properties in a record by number, nor can you enumerate their names.

  • How to retrieve and modify a property's value and how you can use the concatenation operator to effectively add new properties to a record or to update existing ones.

  • That containment operators enable you to test if a record contains one or more properties with particular values.

  • How working with lists of records can be a powerful technique.

  • How to use the copy command to make distinct copies of a list or record. This is in contrast to ...

Get Beginning AppleScript® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.