Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Converting Note Contents to New Indented Notes (Read 4087 times)
Henry Stein
Full Member
*
Offline



Posts: 34

Converting Note Contents to New Indented Notes
Sep 02nd, 2012, 12:00pm
 
Is there a way to automatically convert the contents of all the notes in an outline to new indented notes (the contents become new titles)?  Can the "explode" process do this for an entire file?
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Converting Note Contents to New Indented Notes
Reply #1 - Sep 2nd, 2012, 2:00pm
 
Is the outline you're converting created in some other program?  Or in a Tinderbox text note?  Or is it a Tinderbox document?

If you've got a text outline that uses tabs to indent, Tinderbox will import that file as an outline, making a new note for each line.  Just drag it into a Tinderbox document and you're all set.  It just works.

If you've written an outline in an outliner program, export it to OPML or to a "tab delimited outline".  Tinderbox understands either.
Back to top
 
 
WWW   IP Logged
Henry Stein
Full Member
*
Offline



Posts: 34

Re: Converting Note Contents to New Indented Notes
Reply #2 - Sep 2nd, 2012, 3:07pm
 
The outline was created in Tinderbox.  Essentially, I'd like to convert the text in each note to a new note (title), as an indented child of the original note.  I can do this manually, but am wondering if there is a more efficient strategy.
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Converting Note Contents to New Indented Notes
Reply #3 - Sep 2nd, 2012, 5:09pm
 
Agents and rules cannot create notes, so no, this precise structure can't be automated with agents or rules.

Why do you want to do this? Perhaps there's another approach that's easier.
Back to top
 
« Last Edit: Sep 2nd, 2012, 5:10pm by Mark Bernstein »  
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Converting Note Contents to New Indented Notes
Reply #4 - Sep 3rd, 2012, 4:42am
 
My hunch is with the last post: likely this data has arisen via import and so the problem is better fixed by altering the format of the input data.  But, the question got me thinking.  The coding types could go off and fiddle with the XML source of the TBX - but anyone with those skills likely won't be here asking for help. So, is there a solution of the original question? Well, so of.

First you need to make folder full of new notes (with no $Text or other custom info). You need one note per existing note whose content you need to split. The names of these new notes don't matter as they'll be altered during the main task. How you make the notes is up to you. you could import a list of items or make a few notes in TB, select them and duplicate them (again don't worry about " copy" suffixes as the names of these notes don't matter).

Here we have our notes to be 'split' and 3 new dummy notes. The codeI use assumes their container is a root-level note called "new_notes". You can use any name - just substitute your name for mine in your stamp's code.



Each of the 'source notes has some $text:



Now add a stamp (Stamps menu, Edit Stamp…). NB: that the Stamps menu is not visible if the current app window is a note text window rather than a main view (such as Outline, Map, etc.).  On the Stamps palette, in the Name box type: Make child. In the Action box add the code:

$Container(lastChild("/new_notes")) = $Path +"/"; $Name(child) = $Text;

or if you want the source note to have no $Text after the process use this code instead:

$Container(lastChild("/new_notes")) = $Path +"/"; $Name(child) = $Text;

Now click the Stamps palette's Create button.



You've added a new stamp to the document. Select the notes you want to split (here Ant, Bee and Cow), go to the Stamps menu and click Make child. Here is the result:



Notice how "new_notes" is now empty and that each of the source notes is now a container.  Expand one of the latter:



Sure enough, Ant now has a child note whose $Name is the $Text from Ant.

OK, as said at opening, I suspect the real solution to the original poster's problem is really to not to need to do this task in the first place! But, if stuck with a problem like describe, this is a workaround [sic]. As such, some 'manual' work is needed (creating the dummy notes) but it still saves a lot of effort overall and the risk of keying errors, etc.

Sidenote re the stamp's code:
Why does thestamp's code use the lastChild designator and not child (i.e. the first child)? Well, in testing, if child is used the first selected source note ends up with as many new children s as new_notes contains and all the other selected source have none! I'm not sure if the latter is by design or not, but using lastChild gets us our solution so no need to worry.
Back to top
 
« Last Edit: Sep 3rd, 2012, 4:43am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Henry Stein
Full Member
*
Offline



Posts: 34

Re: Converting Note Contents to New Indented Notes
Reply #5 - Sep 3rd, 2012, 4:58pm
 
First, to explain the reason for the request.  I am working with a student creating a multi-level outline that will permit comments to be inserted in a number of columns.  The student created a top level outline and placed content, that should have been indented titles in the outline, in the text window of the note.  This prevented that text from appearing in the outline view and also prevented comments from being placed in the columns.

I solved the problem manually by creating an Explorer View, then copying and pasting the content of each note into a new indented note in the outline.  A slow, tedious process, but it worked.  I probably won't need to do this any more if the student enters the appropriate material as outline titles and indents the subordinate content.

Thank you for your suggestions.

Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print