SetDirectory["C:\\drorbn\\AcademicPensieve\\2012-08"];
SourceNotebook = "C:\\drorbn\\AcademicPensieve\\2012-08\\muDemo.nb";
CellExport[tag_String] := Module[
{cells},
cells=Cases[
NotebookGet[NotebookOpen[SourceNotebook]], c_Cell /; FreeQ[List@@c, Cell] && !FreeQ[c, CellTags->tag],
Infinity
];
If[Length[cells]≥1,
If[Length[cells]==1,
cells=Append[First[cells], PageWidth -> 340],
cells=Cell[CellGroup[cells], PageWidth -> 340]
];
{
Export[tag<>".png",cells,ImageResolution -> 100]
}
]
];
tags=Cases[
NotebookGet[NotebookOpen[SourceNotebook]],
(CellTags->tag_) :> tag,
Infinity
] // Union;
files=Flatten[CellExport /@ tags];
listing=OpenWrite["listing.txt"];
WriteString[listing, #<>"\n"]& /@ files;
Close[listing];
(* DeleteFile /@ Complement[FileNames[{"*.png","*.pdf"}], files]; *)
(#->Import[#])& /@ files