Chapter 7. Working with Files

Now it starts to get interesting. Up to this point, you haven't known how to access files on your system from your AppleScript programs. This chapter teaches you how to use AppleScript's built-in commands for working with files and folders. Each of these commands is in AppleScript's Standard Additions dictionary.

You may want to get a list of the files in your home directory. Or you might want to back up (in your Documents folder) all the files that have changed in the past 10 days. Perhaps you want to determine the space taken up by all the images you are using for a web page. Each of these tasks can be programmed in AppleScript after you know how to work with files.

Unfortunately, AppleScript's built-in commands do not give you all the power and flexibility you may need for your application. Luckily, the Finder can be used to fill in the gaps. In Chapter 10, you see how you tell the Finder to do these sorts of things for you.

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.