Re: AppleScript and shell scripting
Re: AppleScript and shell scripting
- Subject: Re: AppleScript and shell scripting
- From: Doug McNutt <email@hidden>
- Date: Wed, 1 Aug 2007 08:05:58 -0600
At 23:48 -0400 7/31/07, David Wolfe wrote:
>On Jul 31, 2007, at 9:45 PM, T&B wrote:
>
>>AppleScript provides a language/environment to tell other programs what to do. You can use it to script AppleWorks or iWork to draw object of a particular color, create charts etc. You can use it to create a spreadsheet to perform complex trig calculations, by telling spreadsheet software what to do. By design, it has a very small syntax library within itself, and only basic maths and string functionality. It is designed to glue or automate the functionality of other programs, not re-invent that functionality within itself.
>
>Thank you, Tom, for this paragraph.
Please add my thanks. Then try this on that paragraph :
$Text =~ s/Shell/AppleScript/g;
That description of AppleScript is nothing but the decades-old description of a UNIX shell. The real difference is Apple's, and Linux', decision to elevate the "desktop", "User-GUI", or whatever to a position somehow above the world of executable files. The result is that there is a confusion between logging in to Aqua and logging in to UNIX. A whole list of hacks further confounds the issue.
$HOME/.MacOSX/environment.plist is a prime example - it sets up a user environment that will apply to "do shell script" and Aqua applications. I can boot up a Mac and type a password to log in but I get an entirely different experience if I use ssh from another computer to do the same thing. The Mac then notes my chosen shell from the /Etc/passwd file, starts it up and executes my personal login script to set the environment.
Apple is loudly proud of its decision to use a known stable operating system called UNIX but why did it hide so much with the likes of /private/ and a special scheme for permanently hidden folders. The absolute suppression of the ".app" extension even if you ask to "always show extensions" allows Finder to show two identical filenames for an Applescript, one the compiled script and the other what we once called the APPL. (or is it now AAPL at 4 shares per iPhone.)
A simpler solution that will never happen:
Finder IS a shell. Let it behave like one and handle executables as well as APPLs. Applications should be isomorphic with UNIX executables.
Users should get to select their login shell. They might well choose AppleScript which is another shell as described above.
They might also choose perl which would allow that substitution line I started with.
Or they might choose a BBEdit worksheet which I do on OS neXt even though Finder still insists on being there.
Or I might use MPW as I do on this 8500 right now.
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
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