Re: Finding Filenames that contain a certain string
Re: Finding Filenames that contain a certain string
- Subject: Re: Finding Filenames that contain a certain string
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 20 Jul 2007 08:23:08 -0400
I agree that there's not too much advocacy here. There are certain
individuals who can be counted upon to suggest a Satimage, do shell
tclsh, do shell python, do shell perl, etc solution in certain
problem spaces, but consistency is good. :)
I admit that my first instinct is to reach for the shell, but I've
been writing ksh since 1987 and AppleScript only since 2004. Still, in
my 3 years on this list I think I've picked up on when AS sans shell
is the best solution.
I think my ksh experience is relevant to this discussion, actually.
When I was programming heavily in ksh, I had a tendency to try to do
everything with shell builtins. Why incur the expense of firing up
awk or sed or whatever when there are capabilities within the shell to
accomplish the same goals? Programs like awk and sed were fossils,
holdovers from a time when the shell lacked such features and an
external program was the only way to get the job done.
Well, I was wrong. Sometimes the external program solution is both
shorter and faster. Launching another program may be a relatively
expensive operation, but the speedup in processing once it's launched
often more than makes up for that. Besides, launching other programs
is what the shell was designed to do.
It's also what AppleScript is designed to do. I think shell and AS
work well together.
Oh, about the remark that every shell command has its own syntax:
every scriptable app has its own dictionary, too. I'm no slouch at
AppleScript, but I still have no clue about scripting apps I don't
use, like Filemaker and InDesign and so on.
On 7/20/07, Gary (Lists) <email@hidden> wrote:
"Philip Aker" wrote:
> On 2007-07-20, at 00:13:25, Peter Baxter wrote:
>
>> Is there a users list that uses shell scripting to solve all these
>> problems?
>
> This is it. Since AppleScript implements 'do shell script', anything that
it
> can spawn is legal chat on this list.
All true, but the MacScrpt list is traditionally the list for
"other-than-AS" discussion.
One /could/ argue (and I don't care to...but I do agree) that "do shell
script" is Applescript, but everything between it's quotes is not. ;)
Anyway, I do think that there is some merit to the discussion that some task
and/or assistance requests here can become 'overloaded' with esoteric Unix
tools rather than AS. But, I would /not/ want to exclude suggestions or
mention of shell methods.
It's just that each of those shell tools is /it's own mini-language/ and
therefore it does take quite a bit more, and other, learning to do tasks in
a shell. But some jobs just are much easier there.
It's like anything else, really: balance. At some qualitative point,
recognized only in the moment of any thread about 'do shell script', there
can appear to be heavy-handedness toward some language other than AS.
The reader is really responsible for saying "Okay, I don't want to learn
that trick right now and so I'll ignore it. But now I know for later, when
I'm not under a deadline or piled with frustration."
There's a fine line between suggestion and advocacy, and it's all about that
line. (And, of course, a person rather than a thread can take on that
quality too, with persistent and adamant suggestion for something that is
not AppleScript, per se.) I don't know if there are those persons here or
not, but my own internal "Argggh-o-Meter" doesn't notice that if it's so.
The MacScrpt list is, however, (again) traditionally the place for "all Mac
scripting", including shell.
And don't forget, there are not only AS and shell tools. There's PHP and
Ruby and so on (all usable from within AS, via 'do shell script'), but you
don't see those languages being routinely suggested here. (Even though many
kinds of tasks are more suited to those other languages.)
Just some thoughts. I don't see any real issue lately, myself, and so I'm
not taking any position that this list is overloaded with 'do shell script'.
--
Gary
_______________________________________________
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
--
Mark J. Reed <email@hidden>
_______________________________________________
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