AppleScript for System Admins WebCast
Justin Elliott writes "Watch Apple Computer's own AppleScript wizard, Sal Soghoian, present 'AppleScript For System Admins' during Mac OS X Labs' September 24 webcast. Learn about essential AppleScript tools and tips under Mac OS X. Discover how AppleScript can be used for administrative tasks, and how to use AppleScript to effectively interact with the Mac OS X file system."
Good point - I remember on one of the admin lists some guy obviously from an OS9 background was having problems moving files around with Apple Script. I introduced him to shell scripting - turns out he had about 30 lines of code to essentially do some basic file copying and moving. I showed him he could do the same thing in about 3 lines of shell script.
You have to be careful with shell scripts on the Mac filing system though - you can end up losing the resource forks which breaks some files.
You can download the webcast software, but will not be able to connect or see anything until 1 PM EDT next wednesday.
Where are the shell scripts?
What did you want to do from the shell? Some programs are designed to be used from a command line in the Unix way, others are happier being controlled via the GUI and OSA [which you can still get to from the shell using open(1) and osascript(1)]. Those commands won't completely eliminate Applescript, but they will let you stick mostly to sh and only bring in OSA where the target program demands it.
I wonder sometimes what Apple doesn't gradually dump AppleScript for Python? Think about it: it would give them a scripting platform as powerful as powerful as Java, but (nearly) as simple as AppleScript (perhaps more readable, and certainly more maintainable). Python 2.3 is going to get bundled with Panther, and is used in some core "essential functionality" in Panther and already has bindings to pretty much everything one would needs to tightly stitch to Apple's platform (ojbc, quartz, Java apps via JPE, etc).