MathGroup Archive 2011

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118866] Re: How to select all cells in a notebook with specific property?
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Sat, 14 May 2011 03:04:34 -0400 (EDT)

On 13 May 2011, at 11:26, Nasser M. Abbasi wrote:

> 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?  :)
>
> thanks,
> --Nasser
>

I think what you want can be achieved with Cell tags. You can add/remove tags by selecting
one or more cells and click on Cell > Cell Tags > Add/Remove Cell Tags...
To open/close all cells with a certain tag name, you can use Cell > Cell Tags > Find
Cell Tag > tag name to select them and set/unset Cell > Cell Properties > Open as you did before.

Heike.


  • Prev by Date: Re: Equation numbering
  • Next by Date: Re: Summation of imported data
  • Previous by thread: Re: How to select all cells in a notebook with specific property?
  • Next by thread: Graph[]-related kernel crash bug