Setting Template Variables

Hi there!
I’m opening my first project, and I’m using the simple Novel template. Looking at the Title Page, I notice that the text parts are formatted like code: “$Template_fullName”. Does this mean that there’s a way to set these variables so that whenever I insert the above placeholder, it will fill in the blank for me with a value I previously set somewhere?

How do I set/create the placeholder?

Thank you!

Not yet. When this feature is implemented, it will automatically insert the relevant information into those spots when you create a new project off of the template, and you will not ordinarily see them. I don’t think it is yet decided whether or not this will be in the initial version, or how this information will be set when it is ready to use. If it won’t be in the first version, the built-in templates will be modified to not have placeholders.

Thank you for your reply. Allow me to put in a yes vote for the feature. I believe it would prove very helpful for character names and such that change throughout a manu’s life.

And thank you for this wonderful tool!

I should clarify what this feature does: it specifically sits inside of a template file, and when Scrivener uses that template file to build a new project, it would look for these template codes and insert data from some kind of option pane or address book so that by the time you open the new project, the codes will be gone and replaced with your information. It’s not a system for general replacements and custom tokens. That is something you would not want at the application level, otherwise you’d have a huge mess of tokens for everything you’ve written all jumbled together in one spot.

So to that end there will be a feature where you can set up automatic search and replaces that are done only during compile. Using this, you can indeed create custom tokens and replace them with a character name in the compile panel. That’s a different feature, but also one that is planned.

Aha! I understand. Thank you again. :slight_smile:

Do I understand this correctly? The “tokens(?)” (placeholders) on the title page of the templates won’t work yet, right? So that means we need to manually replace them with the correct info? (Just starting my first project and wanted to make sure be fore I replaced these)

Thanks, Lunarclipper

Yes, just replace them as you would if the template said “My Name” and “My Street Address”.


However, I’ve noticed that the word count variable <$wc100> in the right corner of the title page is replaced on compile with the correct word count rounded to the nearest 100 words.



Some placeholders are already functional, that is correct. The main culprit in the temporary templates right now are the personal info tags that get substituted whenever a new project is created from a template. The <$wc…> placeholders are never evaluated in the editor itself as that would destroy their dynamic nature. They are, like most of them, compile-time tags.

You mention placeholders plural. It just might be handy to see a list of what’s out there in placeholder country, in case they could be useful. Is there such a list somewhere out there?



I would like to cast my vote for enabling the Template variables. I’ve spent half an hour looking for a way to do so before finding this thread. :blush:

Patience is needed here. Lee has a lot on his plate, especially since he has to implement features that weren’t necessary on the Mac version. Apple’s OS X provides a built-in Address book, from which you can grab a user’s info, a built-in spell checker, dictionary and thesaurus as well as a lot of nice programmer esoterica that Windows programming environments just don’t provide. So to make the template placeholders work, Lee may have to decide how to handle stuff that Keith never had to consider, and then actually program the whole solution instead of just plugging into an existing service.

This is just a suggestion: One good way to handle this might be to grab the personal info from the product registration. Another way might be to have am tab in the options section that the user can enter their info into.

I would much prefer a separate option tab or more to enter whatever invariant metadata the template variables need.

I second this.