MathGroup Archive 2009

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

Search the Archive

Re: open one notebook that contains a list of notebooks that will

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101272] Re: open one notebook that contains a list of notebooks that will
  • From: Bob F <deepyogurt at gmail.com>
  • Date: Sun, 28 Jun 2009 23:31:25 -0400 (EDT)
  • References: <h27ff5$cn9$1@smc.vnet.net>

On Jun 28, 4:08 am, pgratz <pgra... at gmail.com> wrote:
> I would like to open one notebook that contains a list of notebooks
> that will then be opened and evaluated.
>
> I cannot even get one notebook open from another notebook.
>
> If I use SetDirectory["c:\Documents and Settings\pg\My Documents
> \Mathematica \
> Project"]
>
> then try :
>
> NotebookOpen["filename.nb"]
>
> it returns "Failed".
>
> Best regards,
>
> Patrick

SetDirectory[] has nothing to do with the NotebookOpen[] function --
see the Documentation Center in Mathematica NotebookOpen entry under
"Possible Issues". The following is what I have done before:

docpath =
 FileNameJoin[{"/Volumes", "bobf", "Documents", "Mathematics",
   "Stewart - Calculus text"}];
nb1 = NotebookOpen[
  FileNameJoin[{docpath, "Stewart Calculus Notes - Chap 12.nb"}],
  WindowMargins -> {{10, Automatic}, {Automatic, 0}},
  WindowSize -> {957, 786}]
nb2 = NotebookOpen[FileNameJoin[{docpath, "Mathematica Issues.nb"}],
  WindowMargins -> {{-1670, Automatic}, {1, Automatic}},
  WindowSize -> {961, 418}]
nb3 = NotebookOpen[FileNameJoin[{docpath, "Trig Common Values.nb"}],
  WindowMargins -> {{10, Automatic}, {Automatic, 0}},
  WindowSize -> {957, 786}, Visible -> True]
FrontEndTokenExecute[ nb3, "WindowMiniaturize"]
nb4 = NotebookOpen[FileNameJoin[{docpath, "Various values of pi.nb"}],
   WindowMargins -> {{10, Automatic}, {Automatic, 0}},
  WindowSize -> {957, 786}, Visible -> True]
FrontEndTokenExecute[ nb4, "WindowMiniaturize"]

So all of this is stored in a file called "startup-stewart.nb", so by
merely opening this notebook and executing this cell I get several
other notebooks opened, a couple of which are minimized when they are
opened (nb3 and nb4).

This works on my Mac, and think this will also work on PC's if you
just put a drive specifier on the first element in the first call of
FileNameJoin that assigns a path to the variable "docpath". In your
example I think this will work:

docpath =
 FileNameJoin[{"c:\Dovuments and Settings", "pg", "My Documents",
"Mathematica Project"}];
nb1 = NotebookOpen[
  FileNameJoin[{docpath, "filename.nb"}],
  WindowMargins -> {{10, Automatic}, {Automatic, 0}},
  WindowSize -> {957, 786}]


HTH...

-Bob


  • Prev by Date: Re: Wolfram | Alpha: Acres per square mile? (oddities)
  • Next by Date: Re: open one notebook that contains a list of notebooks that will
  • Previous by thread: Re: Adding Colorfunction causing poor plot quality
  • Next by thread: Re: open one notebook that contains a list of notebooks that will