MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Re: Finding the Path to/Directory for the current EvaluationNotebook?


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.
>>
>>
> 
> 


  • Prev by Date: Re: why do recursive function calculations take so long in Mathematica?
  • Next by Date: Re: how to simplify a complicated equation?
  • Previous by thread: Re: Re: Finding the Path to/Directory for the current EvaluationNotebook?
  • Next by thread: Re: Finding the Path to/Directory for the current EvaluationNotebook?