Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: printing all notebooks

  • To: mathgroup at
  • Subject: [mg45767] Re: printing all notebooks
  • From: bobhanlon at (Bob Hanlon)
  • Date: Sat, 24 Jan 2004 03:28:18 -0500 (EST)
  • References: <buqmrq$rcs$>
  • Sender: owner-wri-mathgroup at

Use $PathnameSeparator

Bob Hanlon

In article <buqmrq$rcs$1 at>, Murray Eisenberg
<murray at> wrote:

<< 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)?

  • Prev by Date: Re: Related rates
  • Next by Date: Re: printing all notebooks
  • Previous by thread: Re: printing all notebooks
  • Next by thread: Re: printing all notebooks