Re: AppleScript and shell scripting
Re: AppleScript and shell scripting
- Subject: Re: AppleScript and shell scripting
- From: "Stockly, Ed" <email@hidden>
- Date: Tue, 31 Jul 2007 11:59:42 -0700
- Thread-topic: AppleScript and shell scripting
Again, this thread seems interminable. If it's putting you to sleep, please
skip it.
>>> I'm going to call BS on that, again. It's just not so. Some of us reply
with suggestions that the OP use a "do shell script" solution, but I sure
haven't seen that many replies that say "use a different language".
awk/bash/clisp/cut/grep/guile/perl/python/ruby/sed/tcl are not AppleScript
Lauguage. They are either other languages or shells (and shells, IMHO,
constitute almost a different language and syntax for each command). They
are accessible through the AppleScript technology.
A reply that says use any of these is, in essence saying "use a different
language".
>> Sometimes the reason that folk are facing a roadblock isn't because they're
having trouble understanding the language, it's because the language makes it
unnecessarily difficult to do what it is they want to do. Effective, efficient
scripting is all about pragmatism and doing the simplest thing that works.
Religious arguments about language purity are best taken to alt.foo.advocacy
where those that care can debate the issue till the cows come home; the rest
just want to get the job done and move on to the next one as lazily and
speedily as possible.
OK, I'm hoping you'll repeat your rants about the AppleScript language
there.
Here, on the AppleScript Users list, most of the subscribers are AppleScript
Users and for many of us the "Simplest thing that works" is not what
efficient scripting is about.
Efficient scripting for me is what can I write that is easy to understand,
others can understand, that I know I will be able to figure it out after not
looking at it for three years, when I want to rework it, and that it works.
And if it takes a few extra ticks or seconds to finish, I'll pay that price.
If it takes 10 times as many keystrokes, that doesn't bother me.
I prefer writing half a dozen lines of AppleScript to writing a single line
of shell scripting.
Which brings us right back to the beginning of this thread. Mark was in
essence saying that writing a few lines of fairly simple AppleScript was
such a burden, that looping through a list of 26 items was so clunky, that
Shell scripting was required.
Here are the only times I would suggest using shell scripting:
- Working with large numbers of files over a network (1000s of files)
- FTP when you can't be sure that Fetch or Transmit is on the client mac
(And I would make those suggetions on the MACSCRPT mailing list).
>>> If AppleScript wasn't such a grossly deficient language, you wouldn't get
nearly as many folk resorting to shell scripting as a workaround to its
inadequacies in the first place.
If AppleScript were so grossly deficient as you suggest there wouldn't be
that many people using it to begin with. Unless we're all doing things wrong
and just don't know any better.
>>The language is neither fine nor robust. It lacks even the most basic of
functionality that other languages provide as standard - a decent collection of
text, list, math and filesystem commands, built-in hash and file types, and
formal native extension mechanisms for adding your own - while known bugs and
deficiencies (e.g. buggy list-to-Unicode-text coercions, O(n) list access)
persist for year after year.
First, these are completely subjective complaints, and as such, my responses
are also subjective.
Second, it seems that in your comparisons anything that's not the absolute
best, most effective and efficient tool for a particular task is "lousy" or
isn't "decent."
I'm pretty happy with AppleScript's text manipulations. So much so that I
never replaced the XML file parcer I wrote in Vanilla AppleScript years ago.
The list functions could be improved, but with a few pure AppleScript
handlers they can be pretty useful.
Math has gotten better, and there are tools available, some written in pure
AppleScript, some as OSAX, that help. (I never took trig, so I don't miss
it). I wonder how many AppleScripters need trig.
I'm perfectly happy, more than happy, with the file system commands.
A hash function may be nice be nice for some, but given limited resources is
that what we want Apple to dedicate its engineers to work on?
I'm not sure what the complaint about file types is.
Nor what you mean about "formal native extension mechanisms" are OSAX
informal? Or is it that they're non-native on an excel processor? Or by
native do you mean "pure appleScript". (In which case the Library feature
has been built into the language from the beginning).
I've got a feeling this is something very few AppleScripters care that much
about.
Yes, AppleScript has a few bugs, every language has bugs, and Apple is
fixing bugs with every release. Maybe not the bug you're most concerned
about, but they've fixed many.
By the way, let's everyone remember that Apple is actively developing more
software than almost any one in the world. System software, to user
applications, to pro applications, movies, music, photos, and they've just
launched a highly complex product with an entirely new platform.
Sure they could do better for AppleScript, but we have to realize that even
though it may be the most important piece of technology for some of us, in
the big picture for Apple, it has a fairly modest niche.
I'm pleased we're getting as much development as we have.
>>>> OTOH, if you're repeatedly peddling an inferior solution out of religious
zealotry or willful ignorance, you can expect to be whomped increasingly hard
with the clue stick and eventually plonked as a troll.
Lucky for you shell scripting evangelists, the AppleScript users list is a
much friendlier place!
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden