Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Notebook directory' topicStudent Support Forum > General > Archives > "Notebook directory"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ben K.
10/26/05 10:03pm

Is there any easy way to get the path of the current notebook without resorting to AuthorTools? When loading in and saving data files from the notebook, I like them to be in the same directory as the notebook, but since I move between computers (in particular PC and Mac), there is no consistent directory the notebook is in. Additionally, when I turn in an assignment with data files, it's easier for the professor if they can just drop the files into a folder and not have to change any path information in the notebook.
The way I have figured out to get the path is this:
<<AuthorTools`
ParentDirectory[NotebookFilePath[EvaluationNotebook[]]]

If there isn't a simple answer to this, I would suggest it as an addition for the next version of mma. There should be a single function that returns the path or path and filename of the notebook the function is in, and it shouldn't require loading a package to use it.
Thanks.

URL: ,

Subject (listing for 'Notebook directory')
Author Date Posted
Notebook directory Ben K. 10/26/05 10:03pm
Re: Notebook directory yehuda ben-s... 10/31/05 6:31pm
Next Comment >Help | Reply To Topic