Re: AppleScript and shell scripting
Re: AppleScript and shell scripting
- Subject: Re: AppleScript and shell scripting
- From: Doug McNutt <email@hidden>
- Date: Thu, 26 Jul 2007 17:28:20 -0600
At 17:14 -0400 7/26/07, J. Stewart wrote:
>I'm curious about one thing. When did using "do shell script" become "shell scripting"? Near as I can tell the only thing the two have in common is the access of shell commands. Quite a few of the shell's commands are interactive which won't even work correctly via "do shell script"
>
>I've not seen anyone offer more than two or three commands in a "do shell script" solution. After studying a book about 2 inches thick on shell scripting for the last few weeks, that is decidedly not what I'd call shell scripting.
Yep. And a lot of folks don't like "shell scripting" because they only know about "do shell script".
You can't set an environment variable and expect to find it on your next "do shell script".
Looping is almost impossible unless you somehow fit it into one line with semicolons.
tell application "Terminal"
do script in window "named"
end tell
is a way around that kind of limitation. Your named window will remember its environment and your *rc file will get executed. You can also write out shell commands to a file and let the do shell script point to it.
But all of that implies that you're comfortable with the better-documented world of shell scripting in Termina.app or a BBEdit worksheet. That's what pure AppleScripters are afraid of.
Actually it's often easier to invoke AppleScript using the osascript tool within a shell script.
--
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