Archive for 9 août 2011

Kneel before AppleScript !

To say that I am surprised by the sheer success of Lion DiskMaker is an understatement. Actually, I thought that Lion DiskMaker could be just a fun project to deal with and would not have much impact, but the incredible response from every part of the planet is quite thrilling. I am really pleased to see such nice comments from every corner of the planet, and it’s really fun to read about Lion DiskMaker in Twitter.

The stats from this blog are quite interesting as well. Usually, I get about 200 visits per day, sometimes around 1200 visits when I publish a blog post. The fact that I write in French, and note quite often, has, of course, some impact on these numbers.

However, Since last Saturday, there’s been more than 85 000 visits, only on the US page. The French version got  about 20000 visits. It means both these pages have been seen more than 100 000 times. Quite a big number for me !

And of course, there were donations, some quite big ! Thanks to everyone who sent a donation, this is really, really appreciated !

So, I read quite a lots of articles about Lion DiskMaker these days. I found wonderful to see long reviews of the software in so many different languages. Some people even called me « a programmer » ! Wow ! That is the first time it happened ! But hardly myself consider a programmer. Heck, I did not even make a single application using XCode. My day-to-day job is being an Apple Consultant, writing books in his spare time, not programming stuff.

However, in Mac OS X, there is this powerful tool, which has been there even before Mac OS X, which so many people heard of but never really tried to understand.

Of course, I’m talking about AppleScript.

Indeed, AppleScript is far from being a new technology : it arrived in the 90s, with System 7 Pro 1. It was almost canceled as a time, then resurrected and got an incredible boost in Mac OS 8.5. If you want to read a thorough history of AppleScript, check this PDF.

However, since its arrival on Mac OS X, AppleScript earned some bad reputation : its syntax is complicated, it can be difficult to do what you want with it, there are other languages which you can use, like Python, Ruby, tcl… These are comments coming mostly from experienced programmers, not common users.

But the thing is, I am not a programmer. Really. I never learnt C or Pascal at school, I never tried to get C# or Objective-C, or Java, or Ruby or tcl or whatever classic language you may think of. Maybe I tried to learn a bit of BASIC, but it was a long, long time ago. Even HTML is sometimes difficult to get for me (though less complicated than the usual suspects). I don’t dislike these languages. I tried to study them, to understand them. But I always thought they were too complicated for me.

The problem with AppleScript is that it is not designed for full-time programmers. So, programmers sometimes just dislike its simplicity. Respected bloggers like Daniel Jalkut or John Gruber think that Apple should just ditch AppleScript and go full Javascrpt. I hope Apple will not listen : it would mean the end of scripting for (almost) everyone. Sure, AppleScript has its flaws (mostly because of the tools provided to use it, as mentioned John C. Welch in a brilliant post), but it is also amazingly simple. I can’t read Javascript easily. I can open an AppleScript and understand it almost instantaneously, because it uses English words in a sentence-like form2.

When applications implement it properly, you can do amazing things while writing (almost) just plain English. Lion DiskMaker is an ode to my love for AppleScript : though I don’t use it as often as I would like too, I managed to create this application in a few hours, just using the basic AppleScript Editor. Of course, there is some magic inside, and it is provided by the incredibly powerful do shell script command, which can quite easily supply AppleScript the missing commands it would need. Because AppleScript has its limits, which sometimes are a bit too low. But it is not a problem with AppleScript, rather a problem of implementation. And Apple seems ready to improve AppleScript by introducing AppleScriptObjC, which, honestly, I did not try to get into… Not enough time, sadly :(

« Real » developers may laugh because Lion DiskMaker is written with AppleScript. But at the end of the day, we should just see the result. The language behind is just a tool. If AppleScript allowed to create something like Lion DiskMaker, then it means it’s as good as a language as « grown-up » scripting languages while still being easy to understand by non-developpers.

And this, really, is an incredible achievement for AppleScript. If I managed to create Lion DiskMaker almost all by myself, it means that Apple succeeded with AppleScript by making scripting accessible to almost anyone.

  1. Yes, Apple had a « Pro » system a long, long time ago…
  2. At the time I began to work with AppleScript in 1995, I could even write scripts in French ! Multiple dialects were supported, but Apple abandoned them a long time ago. They are not missed, however.

Lion Recovery Disk Assistant contre Lion DiskMaker

Apple vient de lancer un nouvel utilitaire intitulé  Lion Recovery Disk Assistant. Une application qui pourrait vous faire dire que Lion DiskMaker va devoir prendre sa retraite forcée. Pourtant, les deux outils sont assez différents :

  • Lion DiskMaker recrée un disque d’installation complet, alors que Lion Recovery Disk Assistant ne crée qu’une partition Recovery HD. En clair : vous ne pourrez pas réinstaller le système complet. Si vous décidez de réinstaller Mac OS X avec l’outil Apple, vous devrez télécharger ensuite le logiciel d’installation complet de Mac OS X après avoir booté sur le Recovery HD.
  • Lion Recovery Disk Assistant ne peut pas créer de DVD, seulement un disque de démarrage USB, Firewire ou SD-Card. Même si je préfère largement un disque USB à un DVD, il est toujours bien d’avoir le choix ;-)
  • Lion DiskMaker ne fonctionne pas avec les derniers Mac avec OS X Lion pré-installé.  L’outil Apple vous permet de créer un disque de démarrage, et c’est son meilleur point : cela évite de devoir absolument utiliser Internet Recovery. Cependant, vous aurez toujours besoin de télécharger le logiciel d’installation de Mac OS X à partir d’Internet, par exemple si vous souhaitez formater votre disque et réinstaller ensuite le système complet.
  • Lion DiskMaker fonctionne sous 10.6 et 10.7. Lion Recovery Disk Assistant ne fonctionne qu’en 10.7.

Et pour ceux qui se demandent : une nouvelle version de Lion DiskMaker devrait arriver tôt ou tard, avec quelques nouvelles fonctions sympathiques. Ne partez pas trop loin ;-)

 

Lion Recovery Disk Assistant vs Lion DiskMaker

Apple published today a new application called Lion Recovery Disk Assistant. Some may wonder if this means the end of Lion DiskMaker, as it seems they share the same function. However, there are a few differences:

  • Lion DiskMaker recreates the WHOLE Install disk, while Lion Recovery Disk Assistant only creates an external Recovery HD. Which is fine and dandy, but does not allow to reinstall the full OS. If you need to reinstall Mac OS X with Apple’s tool,  you have to download the full Mac OS X installer again after booting on the Recovery HD.
  • Apple’s Lion Recovery Disk does not allow to burn a DVD, only to boot on USB, Firewire or SD-Card. Even if I would rather choose USB over a DVD, it’s still nice to have the choice ;-)
  • Lion DiskMaker does not work with the latest Mac pre-equiped with OS X Lion. Apple’s tool does allow to create an external boot disk. That’s the best point with Lion Recovery Disk Assistant : it makes using Internet Recovery non-mandatory. However, you still need to download Mac OS X from the Internet if you wish, say, to reformat and reinstall the full OS.
  • Lion DiskMaker works in 10.6 and 10.7. Lion Recovery Disk Assistant works only with 10.7.

And for those wondering: a new version of Lion DiskMaker should happen sooner or later, with a few nifty features. Stay tuned :)