• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript and shell scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript and shell scripting


  • Subject: Re: AppleScript and shell scripting
  • From: Kevin Bradley <email@hidden>
  • Date: Wed, 1 Aug 2007 03:00:10 -0500

(I keep telling myself that I'm going to stop contributing to this thread, but it has gotten so darned interesting I can't seem to pull myself away.  Sort of like driving past a bad accident...)

When I learned AS 10 years ago (give or take), it was because it was so much like HyperTalk, which I already knew and loved.  The idea of being able to write just code snippets in HyperCard and have them form a program was so cool!  And the fact that I could control other programs with AS was (at the time) astounding.  Who knew that so many years later AS Studio would leverage all that HyperCard experience?

But over the years I've had to learn DOS batch files, VAX job control, unix shell scripting (and I'm still not good at it), as well as other languages from BASIC to C++.  Each of those "languages" have their own shortcomings and strengths, some more than others.

Yes, I see valid reasons for using shell scripting, especially if what you are trying to do can be done faster or easier with the shell than with AS.  Obviously so do the maintainers of AS at Apple, or they wouldn't have given us "do shell script" in the first place.  I do think there's a place for recommendations of shell scripting when the subject warrants it, and I think that's a common sense attitude that (judging from the thread messages) most everyone would agree with.

I think the real point here is that some feel that suggestion is made too often.  Given the earlier example of Mark's:
set sourceFolder to (choose folder)
tell application "Finder" to set fileList to (every file of sourceFolder
whose name ends with ".c") as alias list

versus

set sourceFolder to quoted form of POSIX path of (choose folder)
set fileList to paragraphs of (do shell script "cd " & sourceFolder & "; ls
*.c")

..the former makes more sense in an AS script than the latter.  But I think what the shell script advocates are saying is that given that OS X is unix (please, no "it's not unix" flames), why not take advantage of it if it makes your life easier?  If it doesn't, don't use it.

In the end, we all wind up using what works for us, an idea so obvious it shouldn't have to be said.  In the pre-OS X days, we didn't have an option other than AS.  Who would have thought that Apple's giving us MORE options would create such discontent?

End of line...

Kevin Bradley
email@hidden
http://macscripter.net

 _______________________________________________
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

  • Next by Date: Re: Fw: Network volume considerations when working with files?
  • Next by thread: Re: AppleScript and shell scripting
  • Index(es):
    • Date
    • Thread