Re: terminal works, do shell script doesn't
Re: terminal works, do shell script doesn't
- Subject: Re: terminal works, do shell script doesn't
- From: Doug McNutt <email@hidden>
- Date: Sun, 27 Jul 2003 14:25:23 -0600
At 00:58 -0400 7/27/03, Scott C. Brown 02 wrote:
>
I wrote an applescript studio app that makes many calls to "do shell sript" to run command line programs.
I snipped it to emphasize the "many calls" part. It's possible that your operations with terminal do things that set environment variables which need to stay around between operations. Sourcing a file of shell commands in Terminal can do that but AppleScript won't.. You can't even change your working directory and expect it to stick.
AppleScript, like Project Builder and the Execute Text service, start a fresh shell each time they "do a shell script". Anything you try to set up with a first shell script will be totally lost when you return and will not be available to a subsequent shell operation.
BBEdit worksheets are better in that they establish an instance of your chosen shell when a worksheet is opened and send subsequent commands to the same place. But it still has no way to set the application's environment as it applies to another worksheet. The only way to do that is by editing $HOME/.MacOSX/environment.plist and in order to change that you have to logout and login again.
Is Panther addressing this?
My son says emacs is the way to go but even it fakes an environment change by trapping a setenv command that might be intended for tcsh and handling it locally. When emacs passes commands to a real shell it passes its own environment without asking. MPW forever. . .
--
--> The U. S. Census Bureau missed a bet by not counting all of those embryos in cold storage. <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.