On 2009-05-11, at 16:52:54, Anthony Adachi wrote:
Interesting. I gather the default current working directory is not something that can be relied upon?
I think one could say it's consistent given the same context. However, that context (even for applications) is determined by the system and has no guarantee that it will be the same in other OS versions.
What you can rely on in Mac OS X AppleScript is the 'path to …' command for getting well known system locations (including the current user's desktop, home, and other user sub-directories) and also, for running AppleScripts (i.e. those not being edited by a script editor), the 'path to me' command to give you the location of the script/applet/droplet currently being run. If you need to run a shell script in a location relative to the currently running script it's:
set p2m to quoted form of (POSIX path of (path to me))
do shell script "cd " & p2m & "; more-code-here"