On 10/24/05 at 9:07 PM, HannesKessler at hushmail.com (Hannes Kessler)
wrote:
>its a typical situation that I want to analyze some data files in
>the same directory where the mathematica-notebook is located. Is
>there a possibility to open the notebook and set the current
>working directory in a different way than issuing a manual
>SetDirectory["...\specific_directory"] command?
>Ideally, there should be some something like a state variable
>$NotebookDirectory one could refer to.
I've put the following into my init.m file
NotebookDirectory[]:=
DirectoryName@ToFileName[
"FileName"/.NotebookInformation@EvaluationNotebook[]]
In any notebook that has been saved, this allows me to insert
SetDirectory@NotebookDirectory[]
in the notebook to have the current working directory set to the directory in which that notebook exists.
--
To reply via email subtract one hundred and four