Re: printing all notebooks
- To: mathgroup at smc.vnet.net
- Subject: [mg45765] Re: [mg45756] printing all notebooks
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sat, 24 Jan 2004 00:36:17 -0500 (EST)
- References: <200401230815.DAA27728@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 23 Jan 2004, at 08:15, Murray Eisenberg wrote:
> Using Mathematica under Windows, the function printDirectoryNotebooks
> defined below prints all the Mathematica notebooks in a user-specified
> directory. For example:
>
> printDirectoryNotebooks["e:\\Temp"]
>
> 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 math.umass.edu
> 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
>
>
>
Modify your function as follows:
printDirectoryNotebooks[dirName_?StringQ] :=
Module[{dir = SetDirectory[dirName]},printNotebook[ToFileName[dir,
#]] & /@ FileNames["*.nb"]]
Works for me under mac OS X 10.3 (Panther).
Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/
- References:
- printing all notebooks
- From: Murray Eisenberg <murray@math.umass.edu>
- printing all notebooks