Re: Notebook programming: SelectionMove[] for nested subgroups?
- To: mathgroup at smc.vnet.net
- Subject: [mg83842] Re: Notebook programming: SelectionMove[] for nested subgroups?
- From: David Reiss <dbreiss at gmail.com>
- Date: Sun, 2 Dec 2007 04:08:37 -0500 (EST)
- References: <fireha$rrk$1@smc.vnet.net>
...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... --David 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