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: Bill Briggs <email@hidden>
- Date: Sat, 21 Jul 2007 08:56:17 -0300
At 7:41 PM -0700 7/20/07, Stockly, Ed wrote:
>Think over the rainbow.
Oh, oh. We're not in Kansas any more Toto.
>Some (not all) Unix shell scripting experts come from a totally different scripting environment than AppleScripters.
Some of us come from neither. I started with Fortran on punch cards. Then to APL on a mainframe terminal. Shell and AppleScript came a lot later.
>Their Unix shell scripting world is all black & white, and they're often doing critical work (someone's gotta vaccinate them bandwidth hogs and then install the north forty).
There's a lesson in that statement of yours - "often doing critical work". That's a tacit recognition of the speed, reliability, and relative lack of bugs that UNIX tools provide. Meditate upon that.
>When they visit realm of AppleScript and AppleScript users and application worklfow scripting and Mac OS X user interface, it's like Dorothy waking up in the land of Oz. Some of them see us as AppleScript "purists," munchkins in our little lullaby leagues and lollypop guilds, sticking to yellow brick roads cause we're brainless, heartless, cowards.
I don't think that's a fair estimate of things. I think we all see the utility of AppleScript (else we wouldn't use it, wouldn't be on the list), but we also recognize that it's domain isn't without bound. Some jobs are just better done by other tools. There are those tasks in the overlap region that you CAN do with AppleScript, but why would you? If I want to demonstrate how multiplicative inverses work in the RSA encryption algorithm and need to do integer math with hundreds of digits, I COULD do it in AppleScript, but I'd check into the clinic to have my head read for doing so. It's just not practical. I need something better for the job. And it's one of the UNIX tools that gives me that. But if I want to mail out information to every student in my FileMaker Pro database concerning their marks, I think AppleScript is great for the job - maybe the only thing that can do this task in the way I want it done (though FileMaker Pro does have its own mail capability).
So it's a case of trying to do things the "best" way, however you want to define "best" (fastest, most reliable, whatever). And AppleScript isn't always the best way to do a job.
>And they may think AppleScripting mac applications is little more than a buff-buff here a touch up there, with a couple of verbose tra-la-las.
Not at all. It's sometimes the only way to get a job done. Or it's faster than writing a program in C or Pascal (at least for me it is). And in some cases it's the duct tape and bailing wire that holds other pieces together. But it's not held in such disdain as you suggest.
>On the AppleScript users list that translates, in some cases, to disdain for
>application scripting,
I don't agree. Application scripting has huge benefits. We all recognize that.
>AppleScript,
Only to the extent that Apple fails to support it to the extent they could/should. If it were done "by the book" in every Apple application and given the resources it needs we'd not feel like it was a second class citizen. And face it, Apple just doesn't do it justice. That's no slight on Sal, Chris or Chris. It's just that the application groups are balkanized and not all of them "get it" as concerns AppleScript.
>AppleScripters,
I don't get that sense at all, but I have to admit that in the last year I've not read much of the list traffic (just due to job-related time constraints, not a lack of interest).
>AppleScript syntax,
Well, this is a legit gripe. Some of the new Cocoa applications have a particularly tortured syntax that is manifestly not "as it was meant to be". Remember that little application the Scriptable Text Editor? That was what it was supposed to be like. It was Apple's "this is how you do it" application. Not many do it that nicely. Every new application is it's own new adventure. Look at three or four simple text editors. They are all a bit too different in ways that probably they shouldn't be as concerns the syntax. Quirks abound. To even suggest that the syntax is uniform or tight is not reasonable. We live with it and work with it, but it pretty much does suck in this department. As Shane said, we've all given up on AppleScript getting the kind of revolutionary support it needs to fix this (i.e., Apple and developers doing it "by the book"). With Cal gone from the scene there's nobody even keeping the book, as far as I can see.
>Applescript technology and our little dogs too.
I'm not much of a dog lover, so I'll leave that one alone.
>And all their chatter about shell scripting and how much better it is than
>AppleScript is just like Dorothy telling everybody she meets that she just
>wants to go home.
In some cases it is better. Some not. When I look at a task I want to automate I decide how to do it based on how long it takes me to write the code and how fast it's going to execute. And whether or not I even know how to do it in the shell, which often I don't. It's a kind of triage operation. If I want to download the entire Silvercash bikini contest photo album I can do it with AppleScript, no problem. But a single line of curl code (that's not at all cryptic) nails it and is much faster. So curl it is. But if I want to move a thousand records from a database to a printed publication done in FrameMaker then the shell is useless as a screen door on a submarine. AppleScript can, however, do that job superbly well. I think we just want to use the better or best tools. Or the best ones we know.
>Well, Shell Scripters, click your heels together and subscribe to the
>MacScripting list and you will be home. And Has is there and Jon is there
>and Emmanuel and Paul and Shane ...
I'm on that list. But it's not got a lot of traffic these days. One gets the impression that there's more "life" on the AppleScript Users list.
But honestly Ed, I would have expected you to embrace the new tools that OS X puts in your hands and to step out of the AppleScript box (OZ, in your metaphor) and learn some of them. All of this griping about shell scripts is really astonishing to me - there's some great stuff outside of the Emerald City, and the drug from the poppy fields won't fog the mind (sorry, I couldn't resist just a bit more of that OZ metaphor).
I'll continue to write AppleScripts every day, but I use Terminal every day too. In fact some of MY tools that I use daily are combinations of the two. I use TypeIt4Me to run AppleScripts (because it can trigger them from my pre-defined mnemonics so I don't need a mouse) and some of these call shell commands from the AppleScript. They get the job done.
So I too am bowing out of any further discussion in this thread. I think we've pulled all the straw out of the scarecrow by now (I'm not implying that Ed's the scarecrow).
Enjoy the weekend.
- web
--
---------------------------------------------------------------------------
There are lots of great productivity tools for the Mac, but for me TypeIt4Me is still the single most useful productivity tool I have. And in the last release it got so good I became a development partner. If you use a Mac, and you'd like to spend a lot less time typing, follow the link and give it a try.
<http://ettoresoftware.com/idevaffiliate/idevaffiliate.php?id=101>
Acknowledgement: I do have a financial interest in TypeIt4Me, and the author is a personal friend. But I would never have become a development partner if it wasn't an enormously useful tool. It's one tool that EVERY Mac user can put to good use.
W. E. Briggs
Moderator of the AppleScripting with TypeIt4Me forum
<http://ettoresoftware.com/forum/index.php?board=5.0>
_______________________________________________
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