Convert details to notes

Convert details to notes

Postby jonpolish » Thu Apr 03, 2014 7:48 pm

Is there a way to convert all details (or just a selection) to notes? Can the same be done for notes (notes to details)?

Thank you.

Jon
jonpolish
 
Posts: 5
Joined: Fri Mar 28, 2014 3:40 pm

Re: Convert details to notes

Postby boercher » Sun Apr 06, 2014 11:13 pm

The following script exchanges notes and details. Call it via "Excecute for all selected notes".
Code: Select all
def oldDetails = node.detailsText
def oldNote = node.noteText
node.details = oldNote
node.noteText = oldDetails


Regards, Volker
boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Re: Convert details to notes

Postby jonpolish » Mon Apr 07, 2014 1:45 pm

Wow, thank you very much. This works great!

Jon
jonpolish
 
Posts: 5
Joined: Fri Mar 28, 2014 3:40 pm

Re: Convert details to notes

Postby seatrout » Fri Apr 11, 2014 8:46 am

What are "Details" in this context?

I have a little script for exporting mindmaps to OPML and so to Scrivener, which only recognises nodes as headlines. This is not what I want - quite often the body of the the thought is in the node text, and the headline is the node above. So here is a quickie that looks for long nodes at the edge of the tree and changes them so the first sentence becomes the OPML heading and the rest is a note

Code: Select all
// @CacheScriptContent(true)
// @ExecutionModes({ON_SELECTED_NODE, ON_SELECTED_NODE_RECURSIVELY})
// fiddled with by ACB 11/4/14 to save the first sentence
import java.text.BreakIterator
try {
   kids=node.getChildren()
   if (kids.size()==0){
        BreakIterator bi=BreakIterator.getSentenceInstance()
      node.note=node.text
      if (node.text.size()>20){
         // should now save the first sentence tidily
         bi.setText(node.text)
         node.text=node.text.substring(0,bi.next())
      }
   }
}
catch (Exception e){
   logger.severe('something broke in the sentence collection', e)
}
seatrout
 
Posts: 88
Joined: Mon Aug 15, 2011 8:32 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest