69 internautes sur 71 ont trouvé ce commentaire utile
- Publié sur Amazon.com
"Can you build us an AppleScript to do that?"
That question has been put to me dozens of times over my ten-plus years doing Macintosh support, and in almost every instance, the answer has been "yes." AppleScript has literally helped me to earn my living, in the sense that I've been hired to build customized applications that--to name just a few--scan the entire content of a weekly newspaper and flag any prohibited words for later exclusion, pull records from a database and turn them into a fully-formatted 32-page pamphlet of health-specific Web sites, and convert the SGML-tagged text from a medical journal into XPress Tags coding for import into QuarkXPress.
I first got turned on to AppleScript at a Macworld Expo back in the 1990s, when I attended a presentation given by a very enthusiastic service bureau employee by the name of Sal Soghoian. Not a programmer by trade, Sal had discovered the joys of AppleScripting while trying to free himself from some of the redundant tasks he was faced with while outputting his client's documents. I was so excited about what I saw him do with his QuarkXPress scripts that I ran up to him after his talk and starting peppering him with questions. Evidently recognizing my enthusiasm, he offered me a free copy of his "Sal's AppleScript Snippets," a 3.5" floppy disk containing a few dozen simple QuarkXPress AppleScript routines and some brief but helpful documentation. From that point forward, I was hooked on AppleScript.
So who better to author an AppleScript training guide for beginning scripters? For the past eleven years, Sal has been the product manager for automation technologies at Apple, and his own enthusiasm for scripting has helped to create a community of AppleScripters who, like me, were exposed to his Macworld sessions and got turned on to all the possibilities AppleScript offers. Sal's co-author, Bill Cheeseman, is no slouch either when it comes to scripting; a civil litigator and trial lawyer by day, he founded the AppleScript Sourcebook Web site (now MacScripter.net), an invaluable reference for scripters, way back in 1996.
Given this book's pedigree, I was expecting it to be the best AppleScript book I've seen to date (at least six AppleScript reference manuals currently reside in my programming library) in terms of introducing the non-programmer to scripting. After reviewing the initial chapters and working through some of the hands-on exercises, I was not in the least bit disappointed. The book truly does begin at "square one" by walking the reader step-by-step through the creation of a Finder toolbar script that is actually useful for restoring your Desktop to a preferred (uncluttered) state, and moves on from there to essential concepts like object references, conditionals, loops, and error handlers. While these concepts might sound intimidating to the newly-initiated scripter, Sal and Bill do an excellent job of making them both understandable and accessible.
As an AppleScripter, I can confirm that documenting the many aspects of this scripting language presents a challenge to any author--note that this book weighs in just shy of 900 pages. Recognizing this, the authors have taken what I consider to be a unique approach to the overall structure of the book. The first twelve chapters, which they call "Instant AppleScript," cover the fundamentals of scripting in a linear fashion, providing enough of a foundation for the reader to get started with basic scripting. Chapters 13-30 serve as more of a reference guide, and are organized in a way that even intermediate and experienced scripters will find useful, with individual chapters on folder actions, scripting connections to network servers, unit coercions (converting distance/weight/temperature, etc.), date scripting, and using the Script Editor, the built-in application used to construct and compile AppleScripts. The third section (that's the "3" in "AppleScript 1-2-3") refers to the downloadable content provided, which includes example scripts, updates, errata, and additional training materials.
Throughout the book, the writing is clear and concise, and each and every script is referenced with an ID, such as "SCRIPT 9.46," so that when multiple scripts appear on a single page or spread, there's no doubt as to which script the text refers. Screen shots are used extensively where appropriate, and the 31-page index is not merely exhaustive, but contains individual entries for each of the symbols employed in AppleScript, not just the terms and concepts. Perhaps equally as helpful, however, was the publisher's choice to use "lay-flat" binding for this book so that you can place it on your desk, open it to page 146, and actually have it remain open to that very page without flopping closed within a few seconds. This might seem like a small thing, but anyone who's ever tried to complete a "hands-on" tutorial from a book that refuses to stay open knows precisely where I'm coming from.
I've found some room for improvement in pretty much every product or book I've reviewed to date, but try as I may I can't really conjure up any creative criticism to offer the authors of "Apple Script 1-2-3." The best I can come up with is that I wish the included screen captures were a bit larger and in color, but that's really a piddling complaint. The bottom line is, if you're a beginner and you're serious about learning how to write AppleScripts, you won't find a better book out there.
Or, to sum up my review in a pseudo-AppleScript context:
set this_Book to "AppleScript 1-2-3"
tell individual "reader"
if (wants to get started with scripting) then
MyMac.com Rating: 5 out of 5
Original Review: [...]