A script to turn each paragraph in a text into a DT doc

Anyone know of an “extra” or script that would let me take an RTF doc, and turn each of its paragraphs into a separate RTF doc in DT? (I have extracted all the highlighted passages and comments from a PDF into a single RTF, and now would like to have each passage exist as a separate doc that I could attach tags to.) If necessary, I could put a character or text string at the beginning of each graph, so the the script could search for that (given that there are likely to be paragraph breaks within single highlighted passages).
Any thoughts/help much appreciated.

Maybe this

or one of the other threads mentioned in that thread. Haven’t tested this in recent years; no time to do so now; but the code looks like it should be ok.

Also, if you happen to own Tinderbox, it does well with exploding text at delimiters.

Thanks, Korm – Now I just have to figure out how to install and use a script, as I have yet to do… But I’m sure there are forum entries on that…
Blake

  • In the little block in the forum posting click “Code: Select All”
  • Copy – ⌘C
  • Open Script Editor (in Yosemite) or AppleScript Editor (early versions of OS X)
  • Create a new document – File > New, or ⌘N, or the New Document button on the file picker when you open the editor
  • Paste the code - ⌘V
  • Compile the script – Script > Compile, or ⌘K, or press the little icon that looks like a pickaxe (or whatever that is)
  • Save the script to your own subfolder of ~/Library/Application Support/DEVONthink Pro 2/Scripts – be sure the file is saved with an .scpt extension, which is the default save in Script Editor
  • In DEVONthink, select the document to explode, navigate to your folder in the Scripts menu (the menu icon that looks like a scroll) and click the scrip to run it
1 Like