[Date Index] [Thread Index] [Author Index]
Re: Find NotebookDirectory
On Fri, 25 Oct 2002, [utf-8] ArtÅ«ras Acus wrote: > I am looking for the simplest way to find EvaluationNotebook > directory. The solution should work in all operating > systems. For example solution bellow, works fine on Linux, but appears > don't on Windows95/98 (Mathematica 4.1). > > StringDrop[DirectoryName[ToString[EvaluationNotebook[ ]]],17] Here is a platform independent approach that uses the undocumented function NotebookInformation. ToFileName["FileName" /. NotebookInformation[EvaluationNotebook]] Bear in mind that if the notebook has not been saved with a file name, then the result will be the string "FileName". A robust solution would include checking for this pathological situation. -- P.J. Hinton User Interface Programmer paulh at wolfram.com Wolfram Research, Inc. Disclaimer: Opinions expressed herein are those of the author alone.