Re: Get current working directory
Re: Get current working directory
- Subject: Re: Get current working directory
- From: Doug McNutt <email@hidden>
- Date: Sun, 2 Oct 2005 17:18:01 -0600
At 08:25 +1000 10/3/05, Shane Stanley wrote in part::
>You may be correct that there's a working
>directory, but I'm not sure that it gets used anywhere.
If you "do shell script" asking for $PWD you must remember that you'll get a new temporary shell that will get some default directory possibly set in a profile or *rc script
One thing that might be considered a working directory is the directory that will be the starting point of a Choose File or Open File request that offers an open dialog. Aqua and carbon applications do seem to remember that. But when you do a save-as after a double-click it's not likely that the dialog will start with the directory of the opened file.
If you're talking to a particular window of Terminal.app there is a working directory that can be changed and remembered but it will not affect the calling AppleScript.
MPW was the first to admit that there WERE working directories in Apple systems. There you could set a directory and expect an open dialog to start there. It no longer works in OS neXt but the only place I know to test it is a BBEdit worksheet. I suppose I could try a choose file from an osascript but i wouldn't know what to do with the result.
One might be able to set the environment variable PWD in $HOME/.MacOSX/environment.plist to set a starting directory for all applications in a login session but I doubt that it would affect the Open dialog. It might work as a starting point for a POSIX path that doesn't start with a solidus.
Apple doesn't think "users" should be exposed to working directories. Too much like DOS.
--
--> As a citizen of the USA if you see a federal outlay expressed in $billion then multiply it by 4 to get your share in dollars. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden