MathGroup Archive 1998

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

Search the Archive

Re: Finding the Path to the Active Notebook


  • To: mathgroup@smc.vnet.net
  • Subject: [mg12513] Re: Finding the Path to the Active Notebook
  • From: "P.J. Hinton" <paulh@wolfram.com>
  • Date: Sat, 23 May 1998 18:10:45 -0400
  • Organization: Wolfram Research, Inc.
  • References: <6jol58$k6h@smc.vnet.net>

On 18 May 1998, Adalbert Hanszen wrote:

> Does anybody know a way, how to programmatically find out, from which
> directory the active notebook was loaded?
> 
> I am looking for something like MyOwnPath[] returning me the full path
> to the active notebook (or None, if the notebook has just been typed in
> without any Notebook-loading).

Give this a try:

MyOwnPath[]:=
  Module[
   {pathName = DirectoryName[ToFileName[
      "FileName" /. NotebookInformation[SelectedNotebook[]]]]},
   If[pathName == "", None, pathName] ]

The type of NotebookObject-returning function fed to
NotebookInformation[] may vary depending on your circumstaces
(EvaluationNotebook[], InputNotebook[], ButtonNotebook[], etc.)

--
P.J. Hinton
Mathematica Programming Group           paulh@wolfram.com Wolfram
Research, Inc.                  http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.




  • Prev by Date: Math. 3.0 on 95 -- Printing problems: Fonts size?
  • Next by Date: Groebner Bases
  • Prev by thread: Finding the Path to the Active Notebook
  • Next by thread: Re: Finding the Path to the Active Notebook