MathGroup Archive 2004

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

Search the Archive

Re: printing all notebooks

  • To: mathgroup at
  • Subject: [mg45778] Re: printing all notebooks
  • From: Mariusz Jankowski<mjankowski at>
  • Date: Sat, 24 Jan 2004 03:29:06 -0500 (EST)
  • Organization: University of Southern Maine
  • References: <buqmrq$rcs$>
  • Sender: owner-wri-mathgroup at

Murray, use the ToFileName function in Mathematica. Mariusz

>>> Murray Eisenberg<murray at> 1/23/2004 3:43:38 AM >>>
Using Mathematica under Windows, the function printDirectoryNotebooks 
defined below prints all the Mathematica notebooks in a user-specified 
directory.  For example:


But it does not work using Mac OS-X.  Can you indicate how it should be 
changed so it will be platform-independent?

   printNotebook[nbname_] :=
     Module[{nb = NotebookOpen[nbname]},
       NotebookPrint[nb]; NotebookClose[nb]; nbname]

   printDirectoryNotebooks[dirName_?StringQ] :=
     Module[{dir = SetDirectory[dirName]},
       printNotebook[dir <> "/" <> #] & /@ FileNames["*.nb"]]

In particular -- and I believe this is part of the problem -- how from 
within Mathematica can one determine the path-separator character 
directly (without, say, querying $System and then accordingly select the 
path-separator character)?

Murray Eisenberg                     murray at 
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

  • Prev by Date: Re: typesetting fractions
  • Next by Date: Re: how to express one expression in terms of other expressions symbolically?
  • Previous by thread: Re: printing all notebooks
  • Next by thread: Related rates