Copying the note header to the body of the text

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.

If you can do it manually, you can do it with KM.

Many thanks for the KM script. Yes, this works more or less exactly what I want. Just the following issues

  1. I have to run it separately for each item. So, if I select 100, it still runs for the first item and stops.
  2. The Note header when it is copied into the note is marked as 1. (header) and then the rest of the items are serially named as 2, 3 etc.

Actually, even if there is some manner in which I can
do the conversion for all my notes that should suffice. I have 1780 notes, running the script 1780 times is a bit of a stretch. And in the video you’ve shown above, it seems to run ok.

I have my diary entries serially numbered as 1. 2. etc. Is that causing the problem?

And lastly, do I have to move the whole set of notes to the ‘Research’ folder? Is that causing the problem, because I tried moving all my notes from the Drafts folder to the Research Folder, no luck with that? It seems to work perfectly in your example video, hence it is exactly what I want.

I’m glad the macro was useful. I am an intermediate KM user, so the macro is not as sophisiticated as it could be. The macro works like this:

  • Select the first item in the Binder you want to convert;
  • trigger the macro;
  • the macro will ask you how many items you want to convert – enter a number and press RETURN;

2022-01-15_12-31-53.411

  • the macro will convert the first item, then move to the second and continue iterating until it has completed the number of iterations you sepcified in the dialogue box.

If I were a more advanced KM user, I would have had the user select a number of binder items, and then I would have had KM count those items and set the number of iterations variable using that count. I think the way to do it (but this is above my pay grade) would be to copy the selected binder items into a clipboard, and then count the records in the clipboard.

if you’re interested in adding that feature to the macro, I recommend visiting the KM Forum, and posting the macro along with your request. The KM forum is quite possibly the most helpful forum on the whole internet, and there are a number of KM ninjas who will help you solve the issue.

I hope that helps.

1 Like

Yes, it does. Many thanks.

I have posted to the KM forum and also given your user name. You can see that here: