Download AppleScript: The Comprehensive Guide to Scripting and by Hanaan Rosenthal PDF

By Hanaan Rosenthal

Show description

Read Online or Download AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition PDF

Best applied mathematicsematics books

Algorithmen kompakt und verstandlich

Ameisen organisieren Städtereisen und ein desktop spielt Schach – wie es geht, das zeigt dieses Buch. Mit ergänzenden Themen und neuen Codebeispielen wird auch in der vorliegenden Auflage für Programmierer, die bereits erste Erfahrungen gesammelt haben, ein breites Spektrum an Problemlösungsstrategien anhand konkreter und verständlicher Beispiele vorgestellt.

Additional info for AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition

Example text

The two variables are assembled into a string that’s assigned to a third variable. qxd 8/29/06 4:06 PM Page 21 CHAPTER 2 ■ SCRIPTING—FROM THE GROUND UP You use the & character to join, or concatenate, the different strings—both the ones that are specified literally and the strings that are stored in the variables. The way in which AppleScript evaluates the concatenation expression is by retrieving the value each variable contains and then passing these values as operands to the concatenation operator (&), which joins the two values to create a new one; the full expression’s final result is assigned to a new variable, my_greeting.

For example, here is a process that is not so suitable for automation: You take the client’s instructions file, and you read the instructions to figure out what corrections the client wants. If the client wants the image to be color-corrected, you open the image in Photoshop and apply curves until it looks better. Otherwise, just correct the typos. This process is much too arbitrary and relies on the operator’s human qualities such as the ability to perform color correction and to correct typos.

OK, that’s not fair. When you start, you just want to get things done, and you don’t care really how. Although writing scripts that way is good for shorter scripts and certainly OK when you’re just starting, you should have an idea of how you should be writing scripts once you get over the initial euphoria that overcomes you every time your computer does something for you and you have to run to get a cup of coffee just so you can tell everyone that “the script did that by itself while I . . while I .

Download PDF sample

Rated 4.93 of 5 – based on 15 votes

Author: admin