Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2376

Re: How to select all cells in a notebook with specific property?

From Albert Retey <awnl@gmx-topmail.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to select all cells in a notebook with specific property?
Date 2011-05-14 07:15 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iqla5t$a0o$1@smc.vnet.net> (permalink)
References <iqgg4u$f0h$1@smc.vnet.net> <iqj13l$rfg$1@smc.vnet.net>

Show all headers | View raw


Am 13.05.2011 12:28, schrieb Nasser M. Abbasi:
> On 5/12/2011 4:26 AM, John Fultz wrote:
>> On Thu, 12 May 2011 04:34:12 -0400 (EDT), Nasser M. Abbasi wrote:
>>> Hello;
>>>
>>> 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.
>>>
>
>>
>> A somewhat obscure but effective work-saving method for what you want to do:
>>
>> * Select all cells.
>> * Open the option inspector with scope set to "selection".
>> * Find the CellOpen option (or whichever is the option you used).
>> * Click to the left of the option.  You'll see an X appear.
>> * Click again, on the X.
>>
>> This procedure will effectively clear any custom settings of the option value
>> for all selected cells.  So if you've set the option on some cells where you
>> don't want the value reset, you'll have to make sure those are not selected.
>>
>
> Thanks John;
>
> The above does help in turning off the option without having to manually select
> those specific cells.
>
> But the problem is not really solved. Since when I want to change
> the property of those cells back to say closed, I would have to go
> select each one of them manually using the mouse, clicking on each
> cell I want to close, and I have to remember which ones I had
> selected before.
>
> What is really needed is a way to manage changing property of cells
> at a group of cells level not just at individual cell level.
>
> Not sure the best design for this, but I would guess a
> user case for this feature goes something like this:
>
> One would select some cells, initially using the mouse, and then
> make them into one set.
> (using some sort of cell->New_set->add_selected_cells_to_set)
>
> This set will be given some identification of some sort, and have the
> notebook remember this. Say cell set 'A123'. The id either
> automatically generated or user supplied.
>
> Later on, one can tell the notebook to select the cells in the
> set 'A123' (as in Cell->Select->Select_existing_set->choose_set)
>
> Now one can and apply the changes to property to the set in one
> command (open them, close them, etc...) as is now done for
> one cell.
>
> One can add more sets, edit the set by removing adding cells to
> it, etc...
>
> This way, I can change the setting/property of a set of cells
> easily each time.
>
> Can we please have this in version 8.1 may be?  :)

I think that this already exists, in a way: Look at the documentation 
for CellTags. It of course does not work exactly how you described, but 
it basically should allow you to do what you want:

1) Give the cells you are interested a cell tag, e.g. closable_cells 
with "Cell" -> "Cell Tags" -> "Add/Remove Cell Tags".

2) Then use "Cell" -> "Cell Tags" -> "Find Tags" to select all cells 
with a given tag.

hth,

albert

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: How to select all cells in a notebook with specific property? John Fultz <jfultz@wolfram.com> - 2011-05-12 11:26 +0000
  Re: How to select all cells in a notebook with specific property? "Nasser M. Abbasi" <nma@12000.org> - 2011-05-13 10:28 +0000
    Re: How to select all cells in a notebook with specific property? Albert Retey <awnl@gmx-topmail.de> - 2011-05-14 07:15 +0000

csiph-web