I assume that I executed the intermediate copy command (Cmd=>c) but it’s possible that I did not. I had to come back to this issue because I needed to have a hardcopy with the hierarchy. First, after manually selecting the binder, the standard “copy” option was greyed out. Copy special was present; copying both “as ToC” and “as Structured Link List” on pasting gave the same result when pasted into an rtf program (I used Wordpad on Windows for this). So how do I copy the hierarchical structure?
My use case requires the binder text to be used as a table of contents; plain text only. Once I got a (non-hierarchical) structure into a text file, I tried to run a sed command on it. The reason for this is that the table of contents structure has to have a specific format for mdbook:
sed -E 's/(^.*$)/[&](.\/&.md)/' input.txt > output.txt
The first time I ran this program it failed. I couldn’t figure out why; then I found that about 125 lines or so had no paragraph endings. Why would some binder entries end with paragraph marks (pilcrows) while others do not? I don’t know. I fixed this by adding paragraph marks (used Textsoap and Textwrangler) and removed all blank lines, after which the sed program ran. However, I found by running the cat command that there were many non-printing characters in the file. A lot of cruft! And not just paragraph symbols, hashtags and the like–running the cat command yielded all this.
This was strange because I had copied everything into an empty text editor (Atom) on the Mac and none of this extra “content” was visible.
I’m adding this in case someone needs to build a plain text file from the binder and needs to troubleshoot. Your text file may contain lots of data you don’t want. When you “copy special” (still don’t get why a simple copy doesn’t work) you may find that there is a lot of hidden information that comes over.
The goal, btw, was to publish the information contained in the Scrivener project file to the web.
My workflow is too complicated: source files to Scrivener, editing there, then export to Markdown (or text) then build a structure in mdbook (SUMMARY.md - mdBook Documentation).
I wonder if there’s a way to directly export to html from Scrivener, using the binder as a table of contents. I have not tried to experiment by compiling directly to html; maybe I’ll try this and see what happens. A long, unpaged file wouldn’t help; I’d need a directory listing and a ToC, the project is 245,000 words or so. A Scrivener to e-pub works well, the problem is that e-pub readers choke on files this big.
(Update 1700 AST) Just compiled to html (web page). The advantage is that all the images transferred flawlessly (they were lost in the “Save as” .txt previously). The disadvantage is that there’s a unpaginated scroll with no means of navigation. The binder doesn’t (as far as I can tell) set up any navigation when compiling to html.