Applescript and launchctl equals beachball

Apple

AppleScript I hate. The concept to have a scripting system to drive Applications is great. The implementation sucks ass. No, really, it’s worth this trip into the dumb language bin. AppleScript is a stupid hack. It’s syntax makes no sense for anybody. Only a couple (and I mean less than hundret) zealots that happen to get scared of any real language still use it. Worst of all: the makers of AppleScript are still with Apple and have given us “Automator”. Just add another layer of crap over another one. AppleScript thinks that people want ‘human readable code’. No they don’t. Specially if it makes no sense at all. End of rant.

It is also plain broken:
launchctl is the utility to start and stop processes for Apples launchd tool. For an application I am writing I would like to start / stop services, and launchctl does just that. I can create a .command file and that makes a shell script clickable. The only caveat is that terminal will launch and the window will not go away once the script is done. Not as neat as it should be. As an aside: stay away from the “Save Settings as Defaults” in Terminal.app. This will also save your current running application for instance as that. If you have a login to another machine, than all future Terminal windows will want to log in to that machine. The remedy is to trash the terminal.plist out of ~/Library/Prefecenses. And the ‘close winow when shell exits’ option does not work. Hence the detour to Applescript. But, that does not work either, since Applescript just beachballs if it launches a launchtl unload ... for instance.

Applescript is a freaking hack. It makes me sad and angry (ok, actually that would be an overstated, computers don't that do that anymore to me) since it's sitting in a place that an amazing application could occupy. Imagine any decent widespread syntax, an API library to all Applications and some GUI glue. That together with some way of version manage / download these 'system scripts' and you would have lots of people developing nice short cuts, meta apps or whatever you want to call it. It would be extending what Unix did 30 years ago for command line applications. Use Photoshop, mail and iDVD in one workflow for instance. Or google, iTunes and a printer in another. You see, it would be awesome. For everybody. But instead Sal and Co. give us what they can come up with. Which is frankly not much. Sigh.