Skip to Content
AppleScript: The Definitive Guide, 2nd Edition
book

AppleScript: The Definitive Guide, 2nd Edition

by Matt Neuburg
January 2006
Beginner
592 pages
16h 55m
English
O'Reilly Media, Inc.
Content preview from AppleScript: The Definitive Guide, 2nd Edition

Properties and Elements

The purpose of the chain of ofs and tells is to navigate a structure formed by objects standing in a relationship of owner and attribute to one another. For example, the phrase folder 1 of application "Finder" is needed because folder 1 is an attribute of the Finder, and because I can refer directly to the Finder but not to its attributes. Figuring out how to form a chain of ofs and tells that will let you refer successfully to a desired object constitutes much of the effort of AppleScript programming, as Appendix A vividly illustrates. An application's dictionary is supposed to help you with this, though it often falls short (Chapter 20). AppleScript's own dictionary is not typically visible, so later in the book I'll list the attributes of the built-in datatypes (Chapter 13).

An attribute is either a property or an element . (In fact, I had to coin the term "attribute" because the official AppleScript documentation lacks any comprehensive term for "property or element.") A property is an attribute that this class of object has exactly one of. An element is an attribute that this class of object may have any number of, and in order to refer to one (or more), you have to say which one(s) you mean.

For example, given a list, length is a property; every list has a length, and that's the end of that. But item is an element; a list might not have any items, and if it does have some, it can have any number of them. To speak of an item or items we have to say which ...

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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

AppleScript: The Definitive Guide

AppleScript: The Definitive Guide

Matt Neuburg
Mastering macOS Programming

Mastering macOS Programming

Gregory Casamento, Stuart Grimshaw
JavaScript Cookbook, 3rd Edition

JavaScript Cookbook, 3rd Edition

Adam D. Scott, Matthew MacDonald, Shelley Powers

Publisher Resources

ISBN: 0596102119Errata Page