Name
TextEdit
Synopsis
The rest of this chapter describes each text-related TextEdit class and gives examples of how to use them in your scripts. As always, to keep up-to-date about any scriptable program on your computer, use Script Editor’s Open Dictionary... menu item to view the software’s dictionary of commands and classes. Chapter 2 , describes application dictionaries.
Dictionary classes
-
attribute run A subdivision of a block of text, an
attribute runis a group of characters that all have the same attributes, such as font or size. Anattribute runis just a different way of abstracting or grouping parts of a text block. For example, if the first paragraph of a document’s text has some characters that are 12 points in size and others that are 18 points, then getting theattribute runs of that paragraph would return two separate chunks of text in alist(one group would be 12 points in size and the other would be 18 points). However, getting paragraph 1 of that text would return one chunk of characters of different sizes. In other words, the paragraph would contain the twoattribute runs. The following example gets everyattribute runof a document’s text (alistcontaining threeattribute runs). The first line of the text contains the characters “hi here is some more text k,” but the last “k” character is in a different font and size than the sentence’s other characters. Consequently, the “k” and its following carriage return character is considered a separateattribute run ...
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