Applescript for Absolute Starters
AppleScript is a revolutionary Apple technology that makes communication between computer programs possible. For example, with AppleScript you can
– retrieve e-mails from Mail and store them in a database;
– tell a picture editing program to change the resolution of a series of pictures, resize them, and send the resulting pictures to another computer or post them on the Web;
– and much, much more.
An AppleScript, or script for short, is a series of written instructions in a scripting language named AppleScript. This language resembles the English language, making AppleScripts both easy to read, write and understand.
Despite its power, AppleScript is heavily used in a couple of fields only. The publishing industry depends on it for workflow automation (PhotoShop, QuarkExpress, InDesign). Filemaker Pro developers use it for creating Mac-based kiosks, which you can find in malls and museums (k-Builder). Apart from the programs mentioned, many more major and minor Macintosh programs like GraphicConverter, BBEdit, and Word are AppleScriptable. That means you can use AppleScript to boss these programs around. Scripting applications is not the focus of this book, however. There are other books on the market that show you how to do that. If these books provide an introduction to AppleScript, it is usually cursory and they quickly dash to the really juicy stuff, which generally requires a modest or good knowledge of the basics of AppleScript. The aim of this book is to provide you just that.
It is intended to update and expand this book on a regular basis. So, you may want to check for new versions (see Chapter 15). A second book on scripting various programs is considered. This book is freeware, and you are encouraged to bring it to the attention of other Macintosh users. In this respect, please pay attention to Chapter 0 in this book on how you can promote the Mac.
Once you dive into the world of AppleScript, you’ll notice that the term ‘AppleScript’ is used quite loosely for three different concepts.
– The AppleScript language: The English-like language which is used to give written instructions to your Mac;
– An AppleScript: A series of instructions, a.k.a. a script, written in the AppleScript language; and
– A part of the Mac operating system (Mac OS X), which actually reads an AppleScript and executes the instructions containing it.
In this book, if there is need to refer to one of these three concepts specifically, the following terms are used respectively:
– The AppleScript language;
– An AppleScript or a script (noun);
– The AppleScript component of Mac OS X.
Learning how to script with AppleScript is ideal as an introduction to programming. It leaves out most of the nitty-gritty work a programmer in a computer language such as Java has to do before she can even perform the easiest of tasks. AppleScript is easy enough that a 10 year old can learn it, yet so powerful that professionals enjoy it too. That leaves plenty of room for growth for you. While not covered in this book, you can even use AppleScript to build computer programs that look and work just like the commercial programs you use on your Mac, with buttons, menus, scrollbars and all. This requires AppleScript Studio, provided for free by your favorite computer company.
How to use this book?
As you will see, some paragraphs are displayed in a green font. We suggest you read each chapter (at least) twice. The first time, skip the green text. The next time you read the chapters, include the green paragraphs. You will in effect rehearse what you have learned, but learn some interesting tidbits which would have been distracting the first time. By using the book in this way, you will level the inevitable learning curve to a gentle slope.
This book contains dozens of script examples. To make sure you link an explanation to the proper script, every script is labeled by a number placed between square brackets, like this: . Most scripts consist of two or more lines. At times, a second number is used to refer to a particular line. For example, [4.3] refers to the third line of script .
You will not learn riding a horse by reading a book. Similarly, you will not learn AppleScript if you don’t get your mitts on your Mac. This is an electronic book. You have no excuse for not switching to the Script Editor (see Chapter 2).
|Download Ebook||Read Now||File Type||Upload Date|
|Download here||Read Now||Epub, Mobi, Pdf, azw3||January 13, 2015|
Do you like this book? Please share with your friends, let's read it !! :)How to Read and Open File Type for PC ?