export text with headings and separator

ds
dspady
Posts: 103
Joined: Thu Sep 16, 2010 12:29 pm

Sat May 12, 2018 3:03 pm Post

I want to export a series of sections, each with the heading (what is written in the binder) plus the associated text. I want to have a section separator so that each pair of heading + text is by itself AND that the section separator is also printed
e.g.
SEPARATOR: Binder Title: text
SEPARATOR: Binder Title: test

ALL of the 'triplets' would then be exported as a single text file.

I have tried to do this in compile and have got nowhere. I even tried to make a custom format, but could not get what I wanted.
How can I do this?
Many thanks
Don

ds
dspady
Posts: 103
Joined: Thu Sep 16, 2010 12:29 pm

Wed May 16, 2018 1:25 am Post

Is no one willing to try and answer this question, or is it just not possible to do.

User avatar
KB
Site Admin
Posts: 20058
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed May 16, 2018 12:08 pm Post

This should actually be quite straightforward, although if you want the separator on the same line like that then I would use a Section Layout prefix rather than an actual separator. Try this:

1. In Compile, click on "+" beneath the Formats list and create a new Format.

2. In Section Layouts, select "Text Section" (you can delete the other Section Layouts if you don't plan on using them).

3. Tick "Title" next to "Text Section" so that titles and text are included.

4. Switch to the "Title Options" tab at the bottom.

5. Tick "Insert title as run-in head". This will put the title on the same line as the text.

6. Enter a colon in the "Title Suffix" area, so that a colon is placed after the title.

7. Switch to the "Prefix" tab (*not* the "Title Prefix", but the "Suffix" tab next to "Formatting" / "Title Options" / "New Pages").

8. Enter "SEPARATOR: " (or whatever you need the separator to be) in the "Section prefix" box.

9. Save the Format (give it a name first if you want).

10. Click on "Assign Section Layouts..."

11. Assign the "Text Section" layout to whichever Section Type your text documents are set to use (e.g. "Section").

12. Click "OK".

13. Compile.

That will result in compiled text that looks like your example, e.g.:

SEPARATOR: First Doc Title: First doc text.
SEPARATOR: Second Doc Title: Second doc text.
SEPARATOR: Third Doc Title: Third doc text.

It's then just a matter of refining the Compile Format settings to make the text look how you want it.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

ds
dspady
Posts: 103
Joined: Thu Sep 16, 2010 12:29 pm

Thu May 17, 2018 2:34 pm Post

This is partially what I want, but not quite.
I am getting
What I am getting is
------------------
Blank line
Formatted text from the Main Window (which is NOT the same as the Binder text title)

Blank Line
Formatted text from the Main Window...
-------------------
There is NO obvious separator

I NEED the separator to be obvious and I want the Binder title text as well
The final file should be called whatever.txt
then
------------------
XXX Binder title
Main Window Text
XXXBinder title
Main Window Text
------------------

My first query should have been more explicit as to my aims .

Basically I want to be able to export parts of my Scrivener file to another program (Index Card), that has as a separator the text ### indicating where a new card should begin. At one time there was a translation program for Scrivener to do this, but with the recent release of Scriv 3 and also a newer version of Index Card, this translation program seems to have gone. However, I can import files by using a text file with a separator for each new card. I want to do this so that I have a title for the Card (which will be the same as the text in the BINDER window), plus the text for the card, which will be the same as the text in the MAIN window of Scrivener.

THUS:
In the Binder, there is text stating indicating an idea of the content of the main window.
In the Main Window, there is text.
I need to make a file that has an obvious separator IN the text file: e.g. ### (this tells Index Card that it should start a new card), then the Binder text (which will become the title for the Index Card), and finally the text in the window.

How do I do that?
Many thanks.

User avatar
KB
Site Admin
Posts: 20058
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu May 17, 2018 3:03 pm Post

Sorry, I'm a bit confused by your reply - did some parts of your reply get missed out? If you followed my instructions, you would have got results exactly like you asked for in your first post. I've attached a sample project that was created by following my earlier instructions. Look at the binder and the editor, then Compile using the "Separator-Title-Text" Format. Is that not what you were after? That does what you asked for in your first post...
Attachments
SectionsTest.zip
(73.43 KiB) Downloaded 29 times
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

ds
dspady
Posts: 103
Joined: Thu Sep 16, 2010 12:29 pm

Thu May 17, 2018 8:20 pm Post

Your program worked fine with your file. I changed your file Separator from SEPARATOR to ###. Saved the file in a folder and then imported it into my file. Then tried it with mine, no luck. NO ###. Went back, downloaded your file again, saved the command file to a folder, opened up a small version of my file (attached) and tried it. No luck. If I entered data into YOUR file (Binder title) Main Window text, Worked fine. ?????

SO: I am attaching the Separator file AND a small portion of the file I am trying to export. I really don't know what I am doing wrong.
Does it matter if the EXPORT is in the DRAFT section or the RESEARCH Section. I tried both.

ALSO, when it does work, the window text should start on a new line. When I tried it with your file, everything was on one line. How do you put a new line command in.

This would give me
SEPARATOR: Binder title
NEW LINE: Main window text.
SEPARATOR: Binder title
NEW LINE: Main window text

Many thanks
Don
Attachments
SepTitlTxtDWS.zip
2files: scrivener sample + compile command
(228.42 KiB) Downloaded 25 times

User avatar
KB
Site Admin
Posts: 20058
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu May 17, 2018 8:26 pm Post

It all worked fine in your project for me. I imported the Compile Format, then used "Assign Section Layouts..." to assign "Text Section" to all three Section Types in the project and it worked. Attached.

I'm not sure what you mean about whether it matters whether the export is in Research or Draft - Compile operates on the Draft folder.
Attachments
TextOutProblem.zip
(238.99 KiB) Downloaded 30 times
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

ds
dspady
Posts: 103
Joined: Thu Sep 16, 2010 12:29 pm

Thu May 17, 2018 10:28 pm Post

That works.
Many thanks for doing this and being so patient about it.
Don

User avatar
KB
Site Admin
Posts: 20058
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri May 18, 2018 5:54 pm Post

Great, glad you have it working!
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."