Chapter 5. Working with Strings

In this chapter, you learn how to work with strings in more depth. You need to know how to manipulate strings to write more advanced programs. For example, you may want to add a suffix onto the end of every filename in a folder. Or you may want to see if each line in a document begins with a particular word.

I show you more about how special considering and ignoring statements can be used for string comparisons. You also learn how to test whether strings begin with, contain, or end with a specified string.

In this chapter, I also show you how to reference elements of a string, where an element can be a character, a word, or an entire paragraph. Understanding how to work with elements is critical to becoming proficient with AppleScript. The use of elements extends far beyond working with strings; you can apply elements to lists and to classes defined by other applications.

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.