• 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
Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts


  • Subject: Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts
  • From: "Anthony Adachi" <email@hidden>
  • Date: Mon, 11 May 2009 17:45:57 -0400

Hello Mark,

On Mon, 11 May 2009 15:31:09 -0400 Mark J. Reed wrote:

>No. Shell script functions are only callable from the shell, and only
>from the specific shell instance where defined.
>
>> File system changes such as these?...
>
>File system changes such as any.  Shell commands can read files, write
>files, delete files, create directory trees, whatever.  The point is
>that
>
>do shell script "cd /some/directory"
>
>followed by
>
>do shell script "pwd"
>
>does not yield "/some/directory".

That brings up another issue.

Who or what is determining the initial working directory of the 'do
shell script' command?

If an AppleScript Applet is run in some sub-directory within a user's
home directory the 'do shell script "pwd"' command on it's own results
in something different than if a shell script containing 'pwd' was run
from the same location....

do shell script "pwd"
--> "/"

Why is the current working directory root rather than the directory from
which the AppleScript script invoking "do script" is running?


Thanks,

-Anthony

 _______________________________________________
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

  • Follow-Ups:
    • Re: Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts
      • From: Philip Aker <email@hidden>
References: 
 >Interacting with external shell scripts (From: "Anthony Adachi" <email@hidden>)
 >Re: Interacting with external shell scripts (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Interacting with external shell scripts
  • Next by Date: Re: Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts
  • Previous by thread: Re: Interacting with external shell scripts
  • Next by thread: Re: Why is the initial working directory of 'do script' root? Was: Interacting with external shell scripts
  • Index(es):
    • Date
    • Thread