Re: Re: Re: Finding the Path to/Directory for the current EvaluationNotebook?
- To: mathgroup at smc.vnet.net
- Subject: [mg43581] Re: [mg43516] Re: [mg43458] Re: [mg43423] Finding the Path to/Directory for the current EvaluationNotebook?
- From: YAT <Yasvir-Tesiram at omrf.ouhsc.edu>
- Date: Sun, 21 Sep 2003 05:42:20 -0400 (EDT)
- References: <200309160836.EAA17106@smc.vnet.net> <200309171159.HAA29726@smc.vnet.net> <200309180940.FAA10669@smc.vnet.net>
- Reply-to: Yasvir-Tesiram at omrf.ouhsc.edu
- Sender: owner-wri-mathgroup at wolfram.com
Yes, thats true. A palette is a notebook and if it is open and is selected then it will be the first object returned by Notebooks[]. I can only think that if any of the solutions provided are excuted before anything else then the directory will be set to the relevant directory. Alternatively a check could be added to my initial post that traverses the palettes directory and finds a string match between Notebooks[][[1]] and each element returned by FileNames[] in the palettes directory. Well spotted Murray Eisenberg. Work-around -- always ensure the relevant notebook is selected. Murray Eisenberg wrote: > Neither this solution, nor a longer one previously posted by > Yasvir-Tesiram, works for me (Mathematica 5.0, under Windows XP): In > both cases the result returned is a directory of a currently-open > palette, namely, a palette that has is always-on-top. > > jmt wrote: > >>Try this : >>SetDirectory[ >> DirectoryName[ >> ToFileName["FileName"/.NotebookInformation[SelectedNotebook[]]]]] >> >>On Tuesday 16 September 2003 10:36, AES/newspost wrote: >> > I want to put a SetDirectory (?) command at the beginning of a notebook >> > that will reset the working directory to the folder containing the >> > notebook itself. >> > >> > Objective is to have the results of any Exports, OpenWrites, etc, >> > executed within that notebook automatically be directed to that same >> > folder -- even if I close the notebook, rename it in the Finder (in Mac >> > jargon), and re-open it. >> > >> > Or, if I Copy or Move the notebook to a different folder and later open >> > it there, Exports or OpenWrites should go to that new, different folder. >> >> > >
- References:
- Finding the Path to/Directory for the current EvaluationNotebook?
- From: AES/newspost <siegman@stanford.edu>
- Re: Finding the Path to/Directory for the current EvaluationNotebook?
- From: jmt <jmt@dxdydz.net>
- Re: Re: Finding the Path to/Directory for the current EvaluationNotebook?
- From: Murray Eisenberg <murray@math.umass.edu>
- Finding the Path to/Directory for the current EvaluationNotebook?