Compiling ONLY custom metadata

I know I can compile custom metadata, I learnt it in the manual and also read it in here:

However, sometimes I need to compile only the custom metadata of documents (mainly for statistical calculations). How can I do that? If I uncheck all of the boxes of the things I can compile (Title, Text, Notes, etc), even if I add de place holder <$Custom:…>, no document is generated. How can I go around this?

Create a Section Layout that only has the metadata content type checkbox selected. Unselect the Title and Text checkboxes. Assign the document’s Section Type to thislayout. Maybe even create a special Compile Format for reuse.

But if I select the metadata checkbox, the list of metadata will appear for each document, but that is not what I want. I only want the custom metadata that I put with placeholders (this one: <$Custom:…>) to appear and nothing else.

You could export selected columns with Custom Metadata from the Outliner to CSV, if you want to use it for statistics in a Spreadsheet…

When you compile only the Notes, you’ll have to place the Custom Metadata into that pane manually, which is suboptimal.

The attached project demonstrates one way of going about this, for both platforms:

metadata_only_compile.zip (142.4 KB)

Windows notes

There is a way of doing this, but you need to work around a bug in the Windows version to do so. You will also find there is another bug whereby empty lines that the compiler itself generates are not seen by Replacements. So you will get empty lines for any items that do not have the custom metadata you are exporting. Fortunately that’s a pretty easy fix in any text editor.

The main issue is that the compiler is designed to omit any binder items that would produce no content. This is ordinarily a good thing, as it avoids doubling up on separators, empty lines and other issues. But the bug in question does this calculation too soon, and thus does not factor in content created solely by the compiler.

Workaround notes...

So the workaround is to give it some content, which allows the item to compile, and then later remove the content with a Replacement.

Some notes on the compile format:

  • When you open the compiler, you’ll see the section layout being used as a struck-out section title. This is just cosmetic, I put it there to illustrate this will be removed.
  • Double-click the “Metadata Export (Win)” Format to examine it.
  • In the Metadata-only section layout, you’ll see we are exporting the Title, and using the Title Prefix/Suffix fields to wrap it in a marker. In the Prefix tab is the custom metadata placeholder.
  • Separators are all set to Single Return, to reduce whitespace (again we can’t entirely eliminate it though).
  • In Replacements, there is a Regular Expression which looks for the markers we add around the title, and anything between them, and replaces the whole thing with nothing, deleting it.
  • Lastly, since we are using plain-text, you do have access to the Processing pane. If you are handy with scripting, this is one way you could solve the empty line problem without any post-processing.

Mac notes

The Mac version doesn’t evaluate for an item being empty until content-creation portions of Section Layouts have been used. So we don’t need the workaround of inserting a title and then deleting it.

For Replacements, we strip out empty lines, leaving a file that contains only a list of used metadata.

3 Likes

This looks interesting, since you could count my scripting experience in a small thimbal, but I’m guessing that the <$custom:Output2> would translate into Output2 equals a specific metadata column.
My Questions are
Do you need to match capitalization when identifing custom metadata column you will harvest?
Can you repeat this placeholder to harvest more than one column of custom metadata at a time?
If there are limits how many columns is it.

I say scripting, because I think you would merely need a very basic understanding of how to put a regular expression into something that can run against a file and either change it, or create another file that is modified from it. All you really need is something that can fix the file with \n\n ⇒ (nothing), after it has been compiled.

Not sure if I quite follow the next two questions, as they all seem very easy to test, with how I’m reading them. More specifically, what are you trying to modify, in the sample project, that isn’t making sense?

If there are limits how many columns is it.

No, you can use all of the placeholders at once.

I wanted to know if you had to match the custom metadata entry exactly including capitalization to make this work. I downloaded and tried it, but I am unable to get the section Title to be visible to associate the metadata I harvest with a file/Scene. If you could help this would be very useful.

Oh, well this sample very deliberately deletes the title, as that conforms with the original request to export nothing but a list of metadata in use. Maybe a more conventional format (like Outline Document) would be a better starting point than any advice in this thread. :slight_smile:

1 Like

This works amazingly! Thank you

I wouldn’t say I’m ‘handy’ with it, but I’ll give it a try. If not, I’ll manage with some post-processing.
Again, thank you <3

1 Like