Replacing AppleScript with Ruby
Subject:   Good idea, but...
Date:   2007-03-01 07:50:03
From:   mattneub
Response to: Good idea, but...

pauls101: Yes, my book is largely about the fact, that the Dictionary is usually frustrating and that AppleScript programming ends up being mostly guesswork. (In fact, my book includes a long Appendix showing me guessing and guessing in order to develop an actual script, and explaining to the reader that this really is how you have to work and think in order to do this stuff.)

Having said that, though, I must say that I'm of two minds about where Apple should go from here. Would it make sense also to throw out Apple events and the object model of properties and elements? It's an attractive idea emotionally (one thinks, let's just use F-Script or some similar alternative). But logically, there is so much invested in existing scriptable apps, and an Apple event, if used properly, is such a powerful means of communication and query, that one suspects that in reality, as I say in the article, Apple events are not going away any time soon. I've seen some pretty good arguments (including some, I think, from Hamish) as to why Apple events and the object model (and the dictionary) are really not so bad.

On the other hand, let's go back to your example. Why does the Finder's scriptability suck? It's because adding AppleScript scriptability to an app in such a way that the result doesn't suck is really, really hard - so hard that Apple can't do it right. It always has been hard. So, that's an argument for your view ("let's throw out the bathwater and the baby - please!").