Export Binder--Not Binder Files--As Text File

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?

Both of the “special” commands only have significance when pasting into Scrivener, given the results of the commands being largely useless outside of it (a bunch of internal Scrivener links and page number placeholders in the former case). Sorry, when you said “an editor” I thought you meant in the project window.

One thing I noticed is that you mentioned you’re using Windows (this is a Mac thread). So I’ve been using the wrong platform to test with. There is indeed a bug with the regular Copy command on the binder. That isn’t working yet—but it’s rather beside the point since that only ever produces a flat list anyway.

But did you try the compile method I mentioned? That should be producing an indented text list.

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.

That’s all quite strange. You seem to be referring to text content having odd paragraph breaks and such, but this command should only be copying titles, right? I’m a bit confused at this point I think. I thought you were just trying to produce a nested list of titles, but it sounds like you’re trying to do something else entirely.

As for weird characters in general, the Edit ▸ Text Tidying ▸ Zap Gremlins command may help. I’ve found the Mac text editor has bugs that cause the insertion of control codes into the document, and this can mess up processing tools that aren’t expecting them.

If you are ultimately trying to get a bunch of .md (or .html) files out of the compiler though, then this post-processing technique would be a good starting point. Since that will be splitting up a long compiled document into multiple files, based on a Layout that inserts a file break separator, it would be easy to keep track of document names and build a ToC file in the background, finally writing it out to a separate file once all of the individual .md files are written out.

Of note: that script was built for someone looking for .tex files, so it would require a little tweaking for another purpose. It is also only set up for Mac use at the moment. The script itself is embedded in the Processing pane settings.