Isn’t AppleScript Marvellous!

Script Editor application iconI reckon that one of the most underrated features of the Mac is (still) AppleScript. If you don’t already know, using AppleScript you can record and automate tasks, extend existing functionality, tie applications together and – using AppleScript Studio – even create proper standalone applications.

Here’s how it helped me lately and re-whet my appetite for adding AppleScript support to Feeder (I know, it should have been there in the first place, but it got postponed).

With Feeder, a common support problem is the FTP publishing. Not once since I replaced the CoreFoundation FTP stuff with cURL has one of these problems been an actual bug; it usually comes down to whether or not FTP Passive Mode is in use or something that I will politely term “user misunderstanding”. 😀

A big part of support is to get information from log files (e.g. your Console log or a crash log) to work out what is going on. With the FTP stuff, you don’t want to be logging all the time and Feeder doesn’t have a transcript window like real FTP clients, so I added a hidden preference to enable and disable this logging as needed.

You may already know that you can view and change an application’s preferences using the “defaults” command in the Unix shell. For example:

defaults read com.apple.iPhoto

AppleScript iconUsing the command-line is a bit scary for many users, so I wrote a quick AppleScript to toggle Feeder’s “FTPDebug” hidden preference. You can download it here.

The script was saved as an application, so to run it you just double-click its icon. If you’ve never seen AppleScript and would like to see the code, just drag it to the Script Editor’s icon in your /Applications/AppleScript folder. You will see that it is almost English.

Yes, there’s stuff like VBScript and you can write Unix shell scripts, but I don’t think any other platform has anything as easy and powerful as AppleScript.

Comments are closed.