MathGroup Archive 2007

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

Search the Archive

Re: Notebook programming: SelectionMove[] for nested subgroups?

  • To: mathgroup at
  • Subject: [mg83842] Re: Notebook programming: SelectionMove[] for nested subgroups?
  • From: David Reiss <dbreiss at>
  • Date: Sun, 2 Dec 2007 04:08:37 -0500 (EST)
  • References: <fireha$rrk$>

...of course this sort of thing might depend on the exact sort of
nesting and detailed arrangement of cell groups.  But here is an
example that assumes the case you mention here.  It assumes that your
insertion point is before the the first cell in your example and that
the notebook object for the notebook that the cells are in is nb:

SelectionMove[nb, Next, CellGroup]

FrontEndExecute[FrontEndToken[nb, "OpenCloseGroup"]]

SelectionMove[nb, After, CellGroup]

SelectionMove[nb, Previous, CellGroup]

FrontEndExecute[FrontEndToken[nb, "OpenCloseGroup"]]

SelectionMove[nb, Previous, CellGroup]

FrontEndExecute[FrontEndToken[nb, "OpenCloseGroup"]]

Hope this helps...


W. Craig Carter wrote:
> Hello,
> I have text cells A, B, C
> C is a subgroup of B; B is a subgroup of A,
> Initially, all subgroups are closed.  I'd like to be able to
> open them one at a time, moving down a subgroup, opening,
> move down another subgroup, etc.
> I've tried doing this with SelectionMOve[nb,Next,CellGroup]
> But, I can't see how to traverse the subgroups...
> Any advice?
> Thanks, Craig

  • Prev by Date: Re: Vieta infinite product formula
  • Next by Date: Re: Re: Bug in SphericalPlot3D?
  • Previous by thread: Notebook programming: SelectionMove[] for nested subgroups?
  • Next by thread: Can't Save Style Sheet with Notebook