Re: How to select all cells in a notebook with specific property?
- To: mathgroup at smc.vnet.net
- Subject: [mg118844] Re: How to select all cells in a notebook with specific property?
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Fri, 13 May 2011 06:25:19 -0400 (EDT)
- References: <iqg61r$d4b$1@smc.vnet.net>
Hi,
> Sometimes I change some cells in a notebook to closed
> (i.e. cell->Cell property->) and then deselect the Open
> property.
>
> I find this useful, when final report is done, and I do
> not need to print some cells.
>
> But when I go back and want to make some edits, I find
> I have to go select all those cells again using the
> mouse, one by one, so I can change the property again
> to open so I can see the content. The cells can be
> in different locations in the notebook.
>
> Is there a way to tell Mathematica to select all cells
> that are say closed, so that I do not have to keep
> doing this manual step each time? It gets tiring
> if there are many cells whose property I want
> to flip. Like Cell->SelectAll-> or such.
I don't think that you expected to get this abuse of FixedPoint as an
answer to that question, but it is all that came to my mind :-)
SelectionMove[EvaluationNotebook[], Before, Notebook];
FixedPoint[
Function[
SelectionMove[EvaluationNotebook[], Next, Cell];
SetOptions[NotebookSelection[EvaluationNotebook[]],
CellOpen -> True];
NotebookRead[EvaluationNotebook[]]
],
NotebookRead[EvaluationNotebook[]]
];
hth,
albert