Copying the note header to the body of the text

I have imported multiple nots into scrivener. On the left, it shows me the header as in say ‘14 Jan 2021’, and on the right the body of the text is shown. I have more than 1500 such notes. I want the header shown in the left to be added to the body of the text in the right. How can I do that in bulk for all my notes?

May I ask for what purpose you want the title of the document as a header in the body?

You can see the title in the bar above the editor with the text body already. And when you compile the notes to whatever format you can chose to add the titles as headers to the notes.

I used to use Evernote many years ago. I didn’t know how to import my EN diaries into another app. I found out not recently that .enex files which EN exports can be imported into via an app called Eagle Filer. Now, it sees that when you export from EN, the file structure is lost. So, in spite of the fact that the body of my original note contains the header, that header is lost when I import. Was wondering if there is an easy at to get it back.

Your compile option is nice. Hadn’t thought of it. But, if I can keep them in my Dropbox and use Scriveners powerful search and other tools that would be ideal.

There is no automatic or convenient way to do that, because it is essentially working counter to Scrivener’s design. The idea here is that an item chiefly consists of:

  • A name
  • Text content

When we compile we can choose to show either of these, both, or even none at all, depending upon the purpose for a section in the outline.

If you open File ▸ Compile... and select a typical compile Format like “Manuscript (Times)” in the left sidebar, then click on the Assign Section Layouts... button in the centre column, you can browse through different ways in which we might print the outline. Note how some of the options include the section title—if you choose that as your layout for these notes, then the “14 Jan 2021” will be printed above the text content using that style for formatting.

So in the end, it is a lot more flexible to keep the title outside of the text, as Scrivener has encouraged you to do by how it imported the notes.

Your compile option is nice. Hadn’t thought of it. But, if I can keep them in my Dropbox and use Scriveners powerful search and other tools that would be ideal.

Hmm, I might be misunderstanding, but there we might be working at odds with the kind of tool you want, though. Scrivener isn’t designed to share its data with other software, like EagleFiler or many other modern Markdown-based editors that use loose files to store their data. It’s format isn’t meant to be edited directly, and isn’t very easy to navigate from other software.

There is a way to get the headings into the text body if you really want that.

Compile all the notes to a (rich text) format including the titles as headers and a delimiter like ===== between them. Then use Import & Split with your delimiter to import them as single items once again, to a different folder or even a different project. Import & Split chops a text into chunks at the delimiters and removes the latter.

Not the most direct way but maybe okay for a one-time transition from Evernote to Scrivener.

1 Like

Thanks, I’ll try this and revert.

You didn’t get that. My diaries are in Scrivener and scrivener uses Dropbox, that’s what I meant. I stopped using EN many years back. And it is only recently that I found Eagle Filer can convert EN .enex files. So, they were imported into scrivener as RTF files which were converted using Eagle Filer. Nothing leaves from Scrivener in the way you seem to suggest.

1 Like

By “on the left”, do you mean the Binder and by “header” do you mean the document name/title?

The rest of my post assumes the answer is yes to those questions.

This is the recommended way to create document headers.

The notes need a section type and the section type needs a section layout. In the section layout, either turn on the Title checkbox (see attachment) or type <$title> in the Prefix.

I did both in the attachment, but you’d only do one of them, or you’d get the title twice. The layout name (note) is greyed out because I didn’t assign it to a section type. Bold ones are assigned, but the others are not, so they’re not doing anything.

Another solution would be to automate this with Keyboard Maestro. (I consider KM to be required kit for Scrivener on MacOS.)

I cooked up a simple conversion macro. Does this solve the problem correctly?

forYK

Here’s the macro, in case it’s useful:

:small_red_triangle:ScrivenerTitle Conversion.kmmacros.zip|attachment (1.9 KB)

No. Headers are created from Binder item titles in the Compile process (at least when the Compile template is set to do so). But the OP wants the headers as part of the notes/text chunks in the Editor already—if I got them right.

For Scrivenings there is a simple view setting for that case by the way.

Compiling the title as a header adds it to the note (though not until Compile), and it is the recommended way to do that.

Since when does Compiling alter text in the Editor? The whole idea of Compile is that it does not. One original (if that’s its proper name), one or many slightly or even totally different looking compiled outputs without changing the original.

But—again: if I got the OP right—the question was about the pre-Compile texts in the Editor. Because of that I suggested to compile with headers exactly like your screenshot shows, add delimiters, and re-import the notes via Import & Split with headers now on top of their text bodies.

You are correct about that, but I’m not assuming the OP is saying what they mean. I’m assuming a much more common requirement, badly stated. If I’m wrong, I’m wrong!

The more I learn about Keyboard Maestro the more I think I should delve into it. Does the macro leave all rich text features like italics intact? Batch processing plain text on a Mac is easy but rich text not so much. And are Scrivener footnotes also still intact? I’m asking because of TextSoap that I am using can’t handle them.

While I am in general assuming that they mean what they are saying. That explains our little discussion[1].

[1] Please note that English is not my first language. If “discussion” bears just a slight hint of aggression I simply picked the wrong word.

The more I learn about Keyboard Maestro the more I think I should delve into it. Does the macro leave all rich text features like italics intact? Batch processing plain text on a Mac is easy but rich text not so much. And are Scrivener footnotes also still intact? I’m asking because of TextSoap that I am using can’t handle them.

If it works when you do it by hand, it’ll work when you do it with KM. It’s just automating what you’d do by hand using the Acessibility feature in MacOS.

I see. Then Keyboard Maestro is (in this case at least) not using the clipboard like TextSoap.

It has no particular connotation for me.

In the macro I posted, I’m telling KM to copy and paste the document title into the text, so it is using the clipboard. Also, KM has a number of sophisticated tools for managing multiple clipboards, and altering the contents of the clipboard as well. Everything from changing case to doing regex search and replace.

KM is like a lego set for Mac automation. You can do everything from simple keymapping to complex data manipulation and decision trees.

I’d be more interested in a macro that converts the Endnote accordingly.