The clip with more improvements
file prefix ~tt stands for "topic to text" AND hopes that because of such unique filename that you'll NOT overwrite an existing file in your Ntab documents directory. (textofile command overwrites an previously existing file of the SAME name). So, as each of the newly generated filenames, you have ~tt"topic".txt (without the quotes).
Does/creates correct number of files now while now it no longer creates any extra blank file.
takes a chunk of ten (or less if it is a small outline) topics at a time, ea topic saved into its own text file.
On larger outline can do 1st ten topics then go back and begin again at the 11th topic in your outline to get more or get all topics.
The strreplace lines exist because I had an outline with some topics that had characters which are considered illegal or not to be used in filenames (the clip names each file with its topic name ie topic.txt).
The 2nd texttofile line if perchance an filename illegal character then, rather than totally skip and not make that file, instead you get a perfectly fine file with a ~beep~ inserted in the filename. (an error will show if that is the case if so just click ok on the io error dialog during processing and continue)
Enjoy, modify to suit, etc. If anybody has a modification request on it, I may be able to do it.
2 texttofile lines are the only long lines.
H="OTL ea topic to text"
; 1st, need to open the outline as a text file: create a
; new file in NTab then click Document | Insert File...and
; browse to the outline you want to open. Then in your
; inserted file, place cursor above 1st "H=" then launch
; this clip which then makes ea OTL topic into an
; individual text file
^!Find "^pH=" SIT
^!IfSame "^%cnt%" "10" premak
^!If ^%cnt% =< 9 lastpar
^!Set %index%=1; %fIdx%=0
^!TextToFile "^$GetDocumentPath$~tt^%namList^%fIdx%%.txt" ^%ea_doc%
^!TextToFile "^$GetDocumentPath$~t^%fIdx%~beep~.txt" ^%ea_doc%
^!If ^%index% >= ^%RowAray0% end
^!Set %row%=^$GetRow$; %col%=^$GetCol$
; ---<end of clip<<