Re: Scripting Additions: Embracing the Horror of Unix
Re: Scripting Additions: Embracing the Horror of Unix
- Subject: Re: Scripting Additions: Embracing the Horror of Unix
- From: Ric Phillips <email@hidden>
- Date: Thu, 31 Jan 2002 10:14:29 +1100
Apple Script's strength is driving apps and in doing so providing the glue
to automate users' workflow.
But, in the absence of other tools Apple Script has found a big audience in
sys-admin uses - if you go to scripters.net or other such places, most of
the effort is focused on scripts that, in effect, manage the file system, or
other environment configurations, like the location manager.
In the unix world the tool set for this kind of work has been the shell
scripting languages and their remarkable child PERL.
Apple Script's value has always depended on application developers taking
the time to provide an aete library for Apple Scripts to access via the OSA.
And I have (only once) grumbled about the problem of the idiosyncratic and
poorly documented classes some software developers produce. Apple scripters
who have a really good idea are still going to experience the "Bugger! - if
only they had provided that class..." syndrome. So that won't change under
OS X.
But system management has changed forever - and Apple Script is no longer
the ideal tool. I am still learning Unix, but I have been using the Win32
version of PERL for some time - and if you want to massage data, manage the
file system, open sockets and implement or use various protocols, spin HTML,
and a hundred other 'hackers' tasks, you just can't go past it.
One PERL regex can rip through thousands of lines in hundreds of files in a
couple of seconds. Yes, you can get the Regex OSAX (and many times I have
been so so grateful to its author!) - and do the same thing in Apple Script
- but it's slower, less powerful, and then if you are going to distribute
the script you have to worry about having that OSAX on any target machine.
The thing is not that the PERL mod community is huge, and it is, but that
the good PERL mods, unlike most of the Apple Script OSAXEN have been
included in the core distribution.
My prediction for the future is that eventually some group of talented PERL
philanthropists (or even Apple if they were smart), will develop an atae mod
for PERL - which would be something special indeed. But even the
availability of regular expressions, and file system control through simple
shell scripting should be welcomed by scripters - it just made your next big
Apple Script project that much easier!
We are all now being reminded of something it is easy to forget when you
work for years in a given environment - knowing a programming language is in
practical terms pretty meaningless - you also have to learn the environment
it runs in to use it effectively. I only really began to learn about the
Apple OS (classic) once I started programming in it. Apple has quite
literally bet the farm on Unix. They call it Apple 'OS' X, but as we know
it's really Apple 'unix'. Truth is, if you are an A grade Apple scripter
under Apple 'OS' you won't be an A grade Apple scripter under Apple 'Unix'
until you know Apple 'Unix' as well as you now know Apple 'OS'.
Think of it as an adventure!