Discussion:
How to select several cells
(too old to reply)
Yuri Kandrashkin
2009-04-28 08:45:54 UTC
Permalink
Hi,

I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
--
Sincerely,
Yuri Kandrashkin, PhD
Bob F
2009-04-29 10:36:34 UTC
Permalink
Post by Yuri Kandrashkin
Hi,
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
--
Sincerely,
Yuri Kandrashkin, PhD
What is the objective of having them all selected? Are these cells
spread all over the notebook or some contiguous block of cells
somewhere in the notebook? If they are contiguous and depending on
what the objective is, perhaps cell groups would be of help. Groups
are new as of version 6 I think. You can collapse an entire "Cell
Group" of cells into only cell by double-clicking only that cell (all
others in the Group become hidden), and then double-clicking the outer
cell bracket all become visible again.

I wonder if Wolfram extended this idea of "Cell Groups" so that cells
need not be contiguous, that this would be a lot more useful?

-Bob
m***@gmail.com
2009-04-29 10:38:33 UTC
Permalink
Post by Yuri Kandrashkin
Hi,
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
--
Sincerely,
Yuri Kandrashkin, PhD
why is that inefficient?
Pillsy
2009-04-29 10:39:06 UTC
Permalink
Post by Yuri Kandrashkin
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
Are your concerns with efficiency because it's slow to tag all those
cells by hand, or that you think that NotebookFind[] takes to long to
find them?

If it's the latter, you've got quite a few other options, also based
on NotebookFind[], which can search based on contents or style as
well. I've found it useful to come up special styles when I want to do
this sort of thing, so that the cells stand out visually as well. You
can also use NotebookGet[] to get the Notebook[] object itself, and
use the standard Matheamtica tools for searching and pattern-matching to find
the cells you're looking for.

If you want more specific advice, you'll probably need to explain what
these cells are and why you need to find them in more detail.

Cheers,
Pillsy
dh
2009-04-29 10:39:39 UTC
Permalink
Hi Yuri,

if you can live with the rather simple mechanism of NotebookFind, you

may use the "All" option. Here is an example:

===========================

a=.;b=.;

nb=CreateDocument[{ExpressionCell[a+12],ExpressionCell[b+Sqrt[b]],ExpressionCell[a

12],ExpressionCell[a /12],ExpressionCell[a Sqrt[b]]}];

s1=NotebookFind[nb,ToBoxes[a],All];

===========================

Daniel
Post by Yuri Kandrashkin
Hi,
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
s***@yahoo.com
2009-04-29 10:42:20 UTC
Permalink
if you Alt-Click a type of cells, input cells, for instance, it will
select all the cells of the same type in the notebook.

if you have to click different type of cells, use shift-Click. But it
sounds like you want to have the mathematica select the cells?
Post by Yuri Kandrashkin
Hi,
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
--
Sincerely,
Yuri Kandrashkin, PhD
d***@gmail.com
2009-04-30 10:18:55 UTC
Permalink
The use of tags and notebookfind is quite versatile....

For some tips on efficient tagging take a look at "The Joy of Tagging:
Manipulating and Mining Notebooks in Mathematica" at

http://scientificarts.com/worklife/notebooks/index.html

--David
Yuri Kandrashkin
2009-04-30 10:20:11 UTC
Permalink
Hi,

I wish to select two or more cells which don`t follow each other. For
example, 1, 2, 5 and 7-th cells in the notebook which in addition can
have different grouping options. It is similar when you select cells
by clicking the mouse button with holded Ctrl(Command) key. This can
be done with NotebookFind but in this case all SHOSEN cells must have
common tag. This method has two drawbacks. First one has to affect on
the cells inserting tags as cell option. Second, this work requires
individual manipulations with every cell, which is inefficient.

The reason for this function is controlling notebook selection (and
evaluation etc) from outside of the notebook itself. Currently I have
engine which creates active table of contents (TOC). The TOC buttons
allow to open/close of the corresponding sections, to manipulate their
options etc. But these operations work on the level of individual
cells. The operations like selection of multiple cells simultaneously
(for example to launch their evaluation) need special function with
options described above.

It might be that there is special FrontEndToken which does this work,
but I couldn=92t find it.

Yuri
m***@gmail.com
2009-05-01 09:24:57 UTC
Permalink
Post by Yuri Kandrashkin
Hi,
I wish to select two or more cells which don`t follow each other. For
example, 1, 2, 5 and 7-th cells in the notebook which in addition can
have different grouping options. It is similar when you select cells
by clicking the mouse button with holded Ctrl(Command) key. This can
be done with NotebookFind but in this case all SHOSEN cells must have
common tag. This method has two drawbacks. First one has to affect on
the cells inserting tags as cell option. Second, this work requires
individual manipulations with every cell, which is inefficient.
The reason for this function is controlling notebook selection (and
evaluation etc) from outside of the notebook itself. Currently I have
engine which creates active table of contents (TOC). The TOC buttons
allow to open/close of the corresponding sections, to manipulate their
options etc. But these operations work on the level of individual
cells. The operations like selection of multiple cells simultaneously
(for example to launch their evaluation) need special function with
options described above.
It might be that there is special FrontEndToken which does this work,
but I couldn=92t find it.
Yuri
But if you don't want to use tags then you still must have some way of
differentiating those cells from the rest. What features do those
cells have that others don't?

Common words, symbols, operators ...?

If you could provide that information it may be possible to provide
suggestions but frankly tagging a cell doesn't seem inefficient to me.
Maybe an extra few seconds per cell after you have just spent several
seconds or minutes typing your cell content.

Mike
Yuri Kandrashkin
2009-05-01 09:27:22 UTC
Permalink
David,
Your presentation is exactly what I have been looking for.
Thanks,
Yuri
Post by d***@gmail.com
The use of tags and notebookfind is quite versatile....
Manipulating and Mining Notebooks in Mathematica" at
http://scientificarts.com/worklife/notebooks/index.html
--David
d***@gmail.com
2009-05-02 09:56:48 UTC
Permalink
Wonderful! It makes me quite happy to be able to help.

Best,

David
Post by Yuri Kandrashkin
David,
Your presentation is exactly what I have been looking for.
Thanks,
Yuri
Post by d***@gmail.com
The use of tags and notebookfind is quite versatile....
Manipulating and Mining Notebooks in Mathematica" at
http://scientificarts.com/worklife/notebooks/index.html
--David
w***@wavebounce.com
2009-05-04 20:41:20 UTC
Permalink
Hi, I got your .nb file on tagging but what does one do with it? I see lots of code but when I run the .nb I get about 15 windows scattered everywhere with no obvious connections. I looked for but failed to find instructions.
d***@gmail.com
2009-05-10 09:17:01 UTC
Permalink
Hi, I got your .nb file on tagging but what does one do with it? I see lo=
ts of code but when I run the .nb I get about 15 windows scattered everywhe=
re with no obvious connections. I looked for but failed to find instruction=
s.

The notebook is the slides for a talk I gave. Its intention is
something that you should read rather than simply execute.... it is a
tutorial giving some tips and tricks for you to use if you want to
know more about tagging....
m***@gmail.com
2009-04-29 10:38:33 UTC
Permalink
Post by Yuri Kandrashkin
Hi,
I wish to select several cells which have separate locations in the
Notebook by Kernel or FrontEnd functions.
One solution is tagging them by common tag and applying NotebookFind.
But this solution seems to be inefficient. Are there other ways?
--
Sincerely,
Yuri Kandrashkin, PhD
why is that inefficient?

Loading...