Teach Yourself AppleScript in 24 Hours
Teach Yourself Applescript in 24 Hours (TYA) from Sams Publishing is certainly up to date: it covers Applescript under OS 10.2 and the use of AppleScript Studio to build GUI applications using the language. That's its strength. The book's first weakness, though, is that it starts too far down the learning curve in my opinion. The first few chapters of TYA could be read by someone almost totally new to the Macintosh -- they cover such basics as running the scripts installed with the OS and getting new scripts from Apple and installing them. At the same time, they introduce basic AppleScript programming terminology not really required for these sorts of tasks such as suites, classes and commands. This material would have best waited a few chapters. It is not really until 'Hour 6', most of the way through the first part of the book, that it really sorts itself out and gets down to really teaching you AppleScript.
The Basics The book is divided into four parts: 'Getting Started With AppleScript,' which covers using scripts and basic programming concepts; 'Writing Scripts With Script Editor,' which takes you through using the Script Editor, details AppleScript syntax and how to script the Finder and various applications and using AppleScript Dictionaries; 'Working With AppleScript Studio,' which covers building AppleScript-based GUI applications using Project Builder and Interface Builder all the way through to complex applications that can store and retrieve documents; and a final section 'Advanced Scripting,' which covers Script Objects, scripting across a network (including SOAP and XML-RPC), and integrating scripts with the terminal and cron.
Each section is then divided up into chapters designed to be worked through in less than an hour ,with a small number of short exercises at the end. I found that most chapters took me about half an hour before I reached the exercises, which then took ten to fifteen minutes.
As you can see, almost everything you could ask for is touched on in this book. Once over the introductory chapters, I found the book to be well laid out, well structured and well written. I particularly liked Part III on AppleScript Studio; it started easily and worked up to quite an advanced little application explaining everything well along the way.
The Bad There are some things missing, however. Debugging is hardly mentioned (3/4 of one lesson), and debugging is not exactly trivial in AppleScript. I also found no mention of my pet demon with AppleScript; its incredibly strong typing and problems with having data in the wrong type; this is a classic problem with files and file names. In reality, this book teaches you the language without really getting down to teach you how to program in the language. A fine distinction, I know, but after just reading Learning Perl Objects, References & Modules, I found TYA to be light on real examples and real world code. Even the best section, the one on AppleScript Studio, didn't touch on many things you will need to know.
Sams have a page devoted to the book at the Sams web site, but frankly the URL is so long and cumbersome I don't dare risk putting it in a post. Go to the site and type 'AppleScript' in the search box. It has the table of contents and a sample chapter and some of the code from the book. The sample chapter is the third chapter 'Running The Scripts You Already Have' and really doesn't give you a good feel for how the book teaches you AppleScript programming. The page to download the code examples says "All the code developed for the book in one convenient download," but in fact all you get are the AppleScript Studio projects and source from four of the chapters. Oh, and the introduction says "There are even a few goodies on the web site that aren't in the book" -- they sure must be good as I couldn't find them.
In conclusion, I think this book starts too far down the learning curve and leaves off too early, with not enough detail. It seems a shame, what we have here is well laid out and well written, I wanted it to be better after I had finished. This book might suit someone absolutely new to the Mac who wanted to learn enough AppleScript to perform a few basic operations, for everyone else it'll be better to wait till October when AppleScript 1-2-3 will be out from Peachpit and AppleScript: The Definitive Guide will be out from O'Reilly, and we might have a better option. If you absolutely need to get some help with AppleScript Studio then borrow someone else's copy or find one second hand.
You can purchase Teach Yourself AppleScript in 24 Hours from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Forget VBscript in 5 minutes.
Je t'aime Stéphanie
Along with Mars day or what?
For those with AppleScript Studio and the Developers Tools installed, head on over to this path for all kinds of cool info: /Developer/Documentation/CoreTechnologies/AppleScr iptStudio/
There's also online resources, naturally: Apple's AppleScript site, AppleScript Studio Essentials docs, the AppleScript Studio mailing list, and lots of other stuff.
I watched C-beams glitter in the dark near the Tannhauser gate.
Now post another kde vs gnome flamewar.
I give this book my lowest rating ever...seven thumbs up!
Froogle price comparisian for this book
Why applescript? Why not a scripting language ... Other scripting languages will
that does all that applescript does and is
also crossplatform? This is not meant to bash
applescript, which is a fine scripting language.
It's just that applescript won't run on Win32,
*NIX, VAX
(python, perl and javascript even).
-d
The problem with this and all other 'in 24 hours' is that they don't come with the 24 pack of red bull needed to keep reading the bastard for a full day. And of course in the morning you'll have forgoten everything but the title of the book.
"Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
I though it was common sense to stay away from all "Learn [Language] in 24 Hours" books.
ever learned X in 24 hours like the book title says?
It adds a whole new dimension of customizability to Mac OS X; now you can script your Mac to the same level you can script Linux/*BSD/Unix. =)
Heh, you must be european. Or is there Red Bull in Capitalist America?
I've owned Macs for a while and I've dabbled with Applescript for maybe 10 minutes at a stretch every couple of years or so. Really, is it that useful? Strikes me it's great in theory, but like Speech recognition it doesn't deliver... How many times a day can you get a kick out of asking your Mac 'What time is it?'
I think the problem is that you misread all the titles 'in 24 consecutive hours.'
-- Fighting mediocrity one bad post at a time.
"either people are in a big rush to learn about computers, or that computers are somehow fabulously easier to learn than anything else. There are no books on how to learn Beethoven, or Quantum Physics, or even Dog Grooming in a few days."
"Let's analyze what a title like Learn (this_language) in Three Days could mean:"
"* Learn: In 3 days you won't have time to write several significant programs, and learn from your successes and failures with them. You won't have time to work with an experienced programmer and understand what it is like to live in that environment. In short, you won't have time to learn much. So they can only be talking about a superficial familiarity, not a deep understanding. As Alexander Pope said, a little learning is a dangerous thing."
"* (this_language): In 3 days you might be able to learn the syntax of (this_language) (if you already knew a similar language), but you couldn't learn much about how to use the syntax. In short, if you were, say, a Basic programmer, you could learn to write programs in the style of Basic using (this_language) syntax, but you couldn't learn what (this_language) is actually good (and bad) for. So what's the point? Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing". One possible point is that you have to learn a tiny bit of (this_language) (or more likely, something like Visual Basic or JavaScript) because you need to interface with an existing tool to accomplish a specific task. But then you're not learning how to program; you're learning to accomplish that task."
"* in Three Days: Unfortunately, this is not enough, as the next section shows."
http://www.norvig.com/21-days.html
having used AppleScript before, I don't see how anything other than a syntax reference would be too useful (and as previous posters have pointed out, such references are available online for free).
there must not be any good SCO stories for today...
This is actually a book review, not an "Apple story."
I see a lot of posts asking why Applescript is useful. Here's one good reason. Salling Clicker. If you have a bluetooth phone and a mac you can write scripts to do just about anything. The sample ones will control iTunes and the DVD player. I have seen scripts for automatic away messages in iChat when you leave bluetooth range. Some people even use it to control presentations. Check it out it's pretty cool.
"Freedom of speech has always been the abstract red-headed stepchild of the Constitution"
-Suck
"debugging is not exactly trivial in AppleScript"
/me waits for Mac zealots to moderate this as a troll...
No, it is not. I've dabbled in two dozen programming languages, and Applescript is the one I've hated the most. It tries to be normal English but because of its strong typing you have to write the sentences exactly correct, which is annoying and hard to figure out once you get past the simplistic 'hello world' stage.
The way you need to string the words together is not obvious, and is sometimes not even proper English. I really wish Apple would wise up and drop it in favour for something more intuitive on the advanced level, like javascript or python.
Slashdot's first reaction to VMware
Most Mac users I know don't know or do anything with AppleScript, so I don't think it's a mistake to start where it does. I have the old O'Reilly book which is still great as a quick reference, but I'll have to see this one for myself before recommending it to people. IMO, a lot of people who could really benefit from using AppleScript daily aren't because they feel it's too techy for them. Maybe this book is what those people need. On the other hand, I haven't heard anything about 1-2-3, but I've had good experience with a few of Peachpit's books.
Alex.
Remember Hypertalk, Apple's first try at scripting? The executable syntax was borrowed from COBOL-60. The data structures were worse: "field 3 of line 2 of card 1352".
And who are those people? Graphic designers have loved Applescript for a looong time, because they can write stuff for Photoshop without any hassles. Big advertizing departments will often have a huge collection of legacy scripts they've written for various big tasks -- "See the dimensions of all the graphics in this directory and add those numbers, formatted this way, to the end of the file names." They aren't programmers, their minds don't work that way, but they do have large programmatic tasks they need to get done.
Let's put it this way: I saw that title, "In 24 Hours," and I wondered how it could possibly take that long.
"Fundamentalism" isn't about divine morality. It's about human authority.
red bull has been sold in the US since 1999.
Then again, it's only that satisfactory if you're the only one having it. Otherwise, saying "Whoa... I know Applescript" would have quite no effect on others. I'd say "Whoa... I understand the sendmail config file!"
I've often wondered who uses applescript. Even in the days of OS 9 its dorky syntax never seemed appealing. Now with OS X you can use something like perl. If you use BBEdit you can run perl scripts right from the editor. I would think that the market for applescript is shrinking everyday.
All right. I remember times when it was the underground drink here, and every now and then, some cool guy would 'import' them from Austria. I drink it every morning, but I'm starting to wonder what happens with all the bull testicle stuff in my body.
"Now I am really confused... On the many occasions I have dabbled with Apple Computers (after the Apple IIe I had in high school), they have been absurdly graphics-centric. Normally, scripting is associated with accomplishing tasks in a command line environment."
Scripting and macros have been part of the Mac user interface since before the actual release of AppleScript. Many Macintosh applications have a second, non-graphical interface available to AppleScripts, allowing them to be controlled or recorded much like the macros in Microsoft Office or the Actions in Photoshop.
We call it the "green apple splatters".
Thank you.
And Bookpool.com has it $1 cheaper than Amazon.
8 7
http://www.bookpool.com/.x/dszq2mdc4i/sm/06723251
On a side note, why was the parent modded as a troll? Anything to save me $7.50 should be modded as informative.
I have a mac. Ok. I was a fanatic for a while, extolling the virtues of Apple at the expense of Microsoft, etc, but I've outgrown it. A little ironic that Apple and Apple concerns are such flamebait here on slashdot... First, all computers are Machines. They (and their software) are all simply tools to get things done in different environments. AppleScript is a useful tool, and a fairly comprehensive and easy to use one. Doesn't this have its place? Shouldn't the digital community see a good tool as worthwhile, and not to be instantly slandered just because it's specialized and for a different market? Just because you don't use it doesn't make it irrelevant. The Macintosh market is a big one, even if it's not as huge as Windows or Linux. It tends to be fairly forward looking, and Apple does a good job making quality software for quality machines. I guess I don't see why it needs to be constantly relegated to the dustbin by geeks with a holier-than-thou attitude.
Interestingly, it's manufactured by a pharmaceutical company. I assume its name comes not from bull testicles, but from Taurine, which is a synthetically formed amino acid. See [[Red Bull]]
"Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
The big lie I always hear about Applescript is that: "Applescript doesn't need lots of documentation, it's self-documenting, english-like, and always current"
While it's true that the little 3rd party documentation out there has major problems (this book, an overly simplistic Jesse Feiler book, an out-of-date Danny Goodman book, and a Mac OS 9 focused O'Reilly reference), I disagree that AppleScript doesn't need documenting.
Foremost, it needs some strong documentation on how application writers should be writing their AppleEvent suites and AppleScript dictionaries. This is by far the most non-standard, conflicting, and outright stupid place to ignore.
Apple has made some half-hearted efforts to write some "standard dictionaries" for suites of software, but if you think css and html are under-specified you haven't looked at these "standards". There's no impetus for you to build the entire "standard" suite into your software. I'm not sure that anyone (including Apple) ever wrote software that actually implemented things like the database suite.
One problem with not standardizing on open, well specified suites is that you can lose all of your script savyness when a key application is discontinued or decides to overhaul their script interface. Those who wrote MacWrite Pro scripts had their work obsolesced overnight when MacWrite was discontinued. Quark scripters are undergoing some pains right now trying to adapt to the new Quark interfaces.
Of course, because AppleScript exposes your data model for all of your competitors, you'll make things like exporting data out of your proprietary file format a trivial operation if you stuck with standard suites or even if you exposed all of your functionality via AppleScript. So making fully AppleScriptable applications is not something that the big guys want to do with their data engines.
Beyond standardization though, AppleScript needs a central repository of script dictionaries and plugins. Right now one's Mac will pick out all of the AppleScript dictionaries on your mac, but what you're trying to automate might be 1,000 times easier in GraphicConverter rather than Photoshop, but if you don't have GraphicConverter on your mac you'll be beating your head against a wall trying to force an app to do something it's not good at. The best one can do today is watch over other people's shoulders via web sites, bbs's, email lists, and by downloading scripts others have written. This whole "steal from someone who's done it successfully" attitude is what makes AppleScript centric web sites seem to spiral into oblivion. Everyone's simply reposting what they've stolen off of other sites, the owne's get frustrated maintaining something that doesn't stand apart from the crowd, and it becomes out of date without constant updates.
I'm not ignorant when it comes to programming, but I find Python and Perl to be syntactically more forgiving and easier to grasp than AppleScript. I find Cocoa to be more standard and more consistently constructed. I find shell scripting to be more accessible and a better "glue" to bind different tasks together.
I must admit that I still do write the occasional AppleScript and if you rely heavily on a program that supports it well then it can be a decent tool. But it's long fallen from favor as my first choice of scripting.
Some do. But 24 hours is an inherently attractive number for marketing.
"Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
This is a very damning problem. One could argue that the O'Reilly book was primarily a reference book. (A reference book dealing primarily with Sys9 and with only a few bits about 10.0 OSX features) But learning Applescript really ought to deal with how to code Applescript.
It is sad that there are not really good books on Applescript. While the language itself is pretty poor (IMO) the concept is excellent. Applescript Studio, while flawed, is a great tool. Most significant, with OSX, you can mix scripting languages to do very powerful things. i.e. most of my scripts are combination shell scrips and Applescripts. I also have a lot of Python/Applescripts. With Apple's GUIScripting additions to Applescript it is an amazingly powerful tool.
The only downside in Apple's toolkit are fairly weak scripting support in some important applications. (cough) Mail (cough). The other downside is debugging, which is surprisingly weak.
If I had a wish, it would be for something like Applescript studio, but with solid debugging and support for shell scripts, Applescripts, Perl scripts, Python scripts and maybe even TCL/TK. It would really be a killer feature for Unix types.
At least the maczealots are out of modpoints by now. Except for the three of them that will hit me. ;)
-Looking for a job as a materials chemist or multivariat
willing to create some new SlashCode to automatically take this troll beneath my viewing threshold? Its getting old... fast.
(It is a moot point though, Acrobat 6 is awful. I went back to 5.1)
A 486/66 is faster than a G5 huh? Even the PC bigots wouldn't believe that one.
My biggest pet peeve with these benchmarks is that they only test one particular operation. How about testing how long it takes the start menu to appear on a 2Ghz PC? How about how long it takes to edit a file in notepad when the only part of the window it displays is the title bar background? How about testing how long it takes to receive an e-mail when an entire University's IT system has been shutdown due to SoBig?
I only use it because I need to use some Classic apps that don't know bash is running.
I have one script that only runs from within Script Editor. It refused to work when saved as an Application.
And, of course, this is a new development. It used to work as an application, but never on the first try. I wized up an put an exception handler in to display a pretty message that "Applescript is acting up today. You have to run your script again."
I guess the new configuration is better. It works from ScriptEditor every time now.
But at least the book review works. I do need such a book and will be buying it.
I have never understood why, but in 1987, there were far, far fewer Mac users than today. But there were Mac books and magazines everywhere. Now, people are surprised when a Mac book is published. "The user base is too small." It was a helluva lot smaller 15 years ago.
I pity the girl. Her whole life lost doing the same thing all over again on a platform she hates.
How come this is still insightful? Who got an epithamy on this one? Who converted to the holy church of MS/Jobs/Linus by reading this troll?
I think, therefore I am...I think.
Why applescript?
I've got a better question.
What am I going to do with the other 22 hours?
I recently started learning applescript to help automate page layout with InDesign. After looking around and trying some demos, it looks like the best software for writing applescript is Script Debugger.i nfo/macosx/ 8048
/ 0970726511/
http://www.versiontracker.com/dyn/more
The bad news is it's $189!
I just ordered a book called AppleScripting InDesign which has good reviews. It's quite pricy though, $40 at amazon.com and I couldn't find it anywhere else. It's a pretty niche book so I guess that's not such a surprise.
http://www.amazon.com/exec/obidos/ASIN
--
A little nonsense now and then is cherished by the wisest men. -Willy Wonka
I seeO'Reilly has a book on this topic on the way. I wonder how it'll stack up. At least we can be reasonably sure that it'll be up to date. O'Reilly usually gets it right. Guess we'll just have to see. I personally looking forward to see how it'll stack up.
Quod scripsi, scripsi.
CLICK HERE
but because of its strong typing you have to write the sentences exactly correct
You mean proper syntax? Most every language I've ever used enforces that. Strong typing in AppleScript?
on run
set x to "A string"
foo(x)
set x to 1
foo(x)
set x to x as string
foo(x)
end run
on foo(some_var)
display dialog some_var
end foo
That script will run. Definately not strong typing.
Here's a cool hack that someone did in applescript that illustrates why one would want to learn Applescript.
Applescript's fairly simple from an object oriented programming point of view and the support built into many applications is cool but it takes forever to debug anything written in it especially because it doesn't always do everything how you would expect it to (A few litte quicks in some of the commands etc). Something that would seem really simple and straightforward oftens ends up behaving much differently than you expect it to. Oh and the syntax seems to be completely bass aackwards but then again it is mac. ;-)
After wasting my money on Feiler's utterly worthless "Mac OS X Developer's Guide" (worst... Cocoa... book... ever...) I wouldn't buy a book about AppleScript or any other subject from this author. Don't just take my word for it--check out the reviews of his books on Amazon, and decide for yourself.
If you're interested in an up to date book on AppleScript, I suggest waiting for "AppleScript 1-2-3" by Apple's AppleScript product manager, Sal Soghoian, which is due to be published this fall.
here
Slashdot likes to break up long strings (such as URLs), so it's best to make them a link.
You can't judge a book by the way it wears its hair.
Do you also believe that Bubble Yum is made of spider eggs? Yeesh, don't believe every silly rumour that goes around...
It doesn't mean much now, it's built for the future.
You're comparing a hello world script to some text parsing code. Get real. Why don't you show me an applescript for parsing a weblog buddy and finding a particular string. I bet it doesn't go like this
Tell file "weblog"
parse itself
find "something useful"
end tell
and I bet it is five times as long as a similar perl script
and slower
and I bet you won't find much help from the internet if you can't figure it out yourself.