Chapter 18. Ten Automation Projects for Text Files

IN THIS CHAPTER

  • The projects

  • Opening text files

  • Asking for text from user

  • Getting a specific word

  • Getting a specific character

  • Getting a specific paragraph

  • Combining text files

  • Getting the definition of a word

  • Using BBEdit: Working with quotes

  • Using BBEdit: Convert spaces to tabs

  • Using BBEdit: Zapping gremlins

Working with text files is something that you're probably very used to if you've come from the world of Perl, shell scripting, Ruby, or any of the dozens of other scripting languages with natural text-processing facilities.

You'll find that both Automator and AppleScript give you quite a degree of control over text files. In this chapter, you'll learn how to work with different aspects of text files.

The Projects

All of the projects in this chapter focus on one area: text files. If you're a programmer, business owner, writer, or anyone else who thrives on words, then you'll likely have lots and lots of text files lying around — or a need to convert from some other format to text.

From a practical standpoint, it's a good thing to be able to manipulate not only text files, but also words, paragraphs, and text selections — and believe me, you'll get plenty of that by creating the workflows (see Figure 18.1) in this chapter.

Choosing a template

Figure 18.1. Choosing a template

The ten projects I'm going to cover are:

  1. Opening text files

  2. Asking for text from the user

  3. Getting ...

Get Apple® Automator with AppleScript® Bible 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.