MathGroup Archive 2005

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

Search the Archive

Re: How can get the Path of current Notebook ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58730] Re: [mg58695] How can get the Path of current Notebook ?
  • From: Igor Antonio <igora at wolf-ram.com>
  • Date: Fri, 15 Jul 2005 14:14:13 -0400 (EDT)
  • Organization: Wolfram Research, Inc.
  • References: <200507150702.DAA23049@smc.vnet.net>
  • Reply-to: igora at wolf-ram.com
  • Sender: owner-wri-mathgroup at wolfram.com

quzhi at quzhi.net wrote:
> How can get  the Path of current Notebook ?
> 
> --
> http://www.quzhi.net
> quzhi at quzhi.net
> 

You can use the information available from NotebookInformation[].

Here's a function that extracts what you want from the notebook where 
the function is evaluated:


NotebookPath[]:= Module[{path},
     path=DirectoryName[ToFileName[ "FileName" /. 
NotebookInformation[EvaluationNotebook[]]]];
     If[path = "",
         Print["Notebook has not been saved yet."]; Return[$Failed];,
         path
     ]
]

You can change that function to return whatever you want.  You could 
also modify it to accept a NotebookObject as an argument.  If you do 
that, simply replace "EvaluationNotebook[]" with the argument's name.

-- 


Igor Antonio
Software Technology
Wolfram Research, Inc.
http://www.wolfram.com

To email me personally, remove the dash.


  • Prev by Date: Re: Graphical modeling of extinct lifeforms with Mathematica
  • Next by Date: Re: How do I add a secondary y-axis to MultipleListPlot
  • Previous by thread: How can get the Path of current Notebook ?
  • Next by thread: Re: How can get the Path of current Notebook ?