Re: Scripting Additions: Embracing the Horror of Unix
Re: Scripting Additions: Embracing the Horror of Unix
- Subject: Re: Scripting Additions: Embracing the Horror of Unix
- From: Jon Pugh <email@hidden>
- Date: Wed, 30 Jan 2002 22:47:42 -0800
At 10:36 PM -0800 1/28/02, Jon Pugh wrote:
>
That ought to spark a debate. ;)
Tee hee hee!
At 10:55 AM -0800 1/30/02, Stockly, Ed wrote:
>
I've avoided it for a time by not Scripting OSX at all.
Wuss. ;)
Actually, I was doing the same thing. I finally hucked myself into it though and committed to making my computer do my work for me. I had to port a bunch of scripts from the Perforce MPW tool to the unix version of the tool. This has not been easy, although it hasn't been rocket science either. Script Debugger has helped immensely since I created a library script with useful subroutines in it and referenced that via SD's Libraries tab. Then I just called subroutines as I reworked all my scripts.
It's a bunch of AppleScripts that funnel down into one subroutine that calls the "do shell script" scripting addition. You see where I'm coming from?
At 8:01 AM +1100 1/31/02, Shane Stanley wrote:
>
All the unix experts seem to agree that the file commands in Jon's can be done using do shell script, for example, but not one of them seems willing to actually spell out how, despite repeated hints...
Hey, I don't tell you how to mind the sheep. I've got a paying job that keeps me plenty busy. ;)
cp, ditto, cpMac - copy files
mv - move files
rm - delete files
mkdir - make directory
rmdir - remove directory
ls - list files
ps - list processes
pwd - print working directory
cd - change directory
cat - display file
more - display file to a human
man - I wish there was a help command
Now you know as much unix as I do.
The Unix Hater's Handbook is out of print but still widely available. I've heard of these things called libraries too. ;)
At 9:21 AM +1100 1/31/02, Shane Stanley wrote:
>
Jon: I want copyFile back ;-)
As the marketing weasels would say, "But what are you willing to pay for it?"
Economics rule my world these days, and Jon's Commands ain't paying the bills.
At 10:14 AM +1100 1/31/02, Ric Phillips wrote:
>
Apple Script's strength is driving apps and in doing so providing the glue
>
to automate users' workflow.
And it will continue to do this. AppleScript will continue to do a lot of things. It's almost been promoted to the level of a real programming language, with AppleScript Studio allowing you to create real applications in AppleScript.
At 5:33 PM -0800 1/30/02, Stockly, Ed wrote:
>
You know, some how I just knew that shell commands wouldn't be as intuititive as AppleScript commands.
Like that's a big secret. Unix is the antithesis of "user friendly" and proud of it. However, my point is simply that you cannot be afraid of unix. It's just another tool. You can ignore it if you want, but making it your slave is a much more powerful proposition. Doing so from AppleScript just shows the world how studly you really are.
At 10:46 AM -0600 1/30/02, Michael Grant wrote:
>
On 1/29/02 2:56 PM, "garbanzito" <email@hidden> wrote:
>
> so can you read the man pages (ManOpen
>
> is a nice GUI app for this)
>
>
It's prob'ly just me, but I have to admit that I never understood the point
>
of using a GUI tool to read man pages. What am I missing?
I can't recommend ManOpen highly enough. I especially appreciate the dichotomy of reading man pages in a nice window that allows interactive scrolling with the mouse wheel and doesn't get bumped off screen by my typing.
<tangent>
I decided to lookup dichotomy, so I used this nifty Eudora script:
tell application "Eudora"
set t to selected text
end tell
tell application "Internet Explorer"
GetURL "
http://www.dictionary.com/cgi-bin/dict.pl?term=" & t
Activate
end tell
Try and do THAT in perl or a shell script. And I know that dict.pl *is* a perl script, OK?
</tangent>
At 6:43 PM -0800 1/30/02, Stockly, Ed wrote:
>
I think they call that segment "The rest of us."
And we're not going anywhere, because we're a diverse crowd. I personally hope that AppleScript grows in power to match that of the Unix shell scripts, but to do so I think it's going to have to embrace and extend. Some judicious programming can easily make it simple and fast to run shell scripts from AppleScript, or to just invoke unix tools themselves, but AppleScript's real strength isn't doing text processing or file IO. It's controlling the flow between programs and interacting with the GUI. Unix complements AppleScript, and AppleScript has the potential to bring friendly UI control to the unwashed Unix masses.
So, instead of this sort of unix thing replacing AppleScript and scripting additions, I see it augmenting. Frankly, "the rest of us" are searching for a workable solution, not an elegant example. Of course, we'll take the elegant ones when possible, but we have deadlines.
Unix gives all AppleScripters a lot of power. How they use it is their business, but ignoring it is probably the wrong thing to do.
At 10:55 AM -0800 1/30/02, Stockly, Ed wrote:
>
I would see it as the death of AppleScript as we know it.
Don't worry, the glass is half full.
At 10:14 AM +1100 1/31/02, Ric Phillips wrote:
>
Think of it as an adventure!
Unfortunately it already is. With any luck we'll survive to tell the tale.
Jon