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."
or maybe not
Where are the shell scripts?
AppleScript rocks. It's a great way for users (that's users, not geeks) to automate stuff on a Mac. Its biggest power is probably the english-like language.
Like this iChat AV example:
tell application "iChat"
send video invitation to account "John Doe"
end tell
You can download the webcast software, but will not be able to connect or see anything until 1 PM EDT next wednesday.
... as the webcast reaches its 500-person limit, all because it was posted on /., and people who are "just curious" tune in.
AppleScript is like Perl's forgotten twin brother: Perl is fast to write and impossible to read, and AppleScript is highly readable but impossible to keep "in your head" .. too much like a weird dialect of english.
.. for instance you can generate diagrams in OmniGraffle diagramming tool entirely through scripts! I was trying to create a script to generate ERD from MySQL schema but gave up after a while because AppleScript is so chewy.
That being said it *rocks* for controlling GUI apps
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).
I've written many thousands of lines of AppleScript, and I hate the language with a passion.
The promise and premise are great, and if the apps you want to use are scriptable, you can do a lot.
But I have found it to be my least productive environment, by an order of magnitude.
Like another poster said, the syntax does NOT stick in your head. Data structures are inconsistent and counter-intuitive. With each new app & set of objects you have to learn new ways by trial and error of actually getting things to work. And under OS 9, sometimes you would be, no exaggeration, rebooting every 10 minutes. At least that's in the past.
You can ditch it and use Javascript, using Late Night Moon's OSA Javascript, but that doesn't solve the problem of inconsistent data structures & api, just wraps them in a syntax that makes sense instead of sounding like filtering your code through the mind of a drunken schizophrenic who knows nothing about programming.
By contrast, Macromedia ROCK at scripting. Fireworks & Dreamweaver have AMAZING solid, complete, sensible, usable scripting api's. If only every app would have such scripting. And now Fireworks can run without gui & you can talk to it directly with c++. Awesome.
You can call AppleScript from other scripting languages (Python/Perl/Bash, etc) and call other scripting languages from AppleScript, so you can do each manipulation in whatever language you find most convenient. I usually find it easiest if you keep AppleScript for manipulating objects within your application (Quark) and do the backend data manipulation in Perl etc.
Apple has a page about using 'do shell script' to invoke UNIX scripts from AppleScript
To go in the reverse direction, you invoke the AppleScript using