Requesting a Placeholders/Variables/Macros feature, e.g. where I can type $hero$ and it'll be displayed as Bilbo

Of course, this has been suggested a few times before: … lder+names

And of course, the general response seems to be: “use Find & Replace!” but again of course, that isn’t always reliable, or convenient.

I just started using Scrivener yesterday, to dabble in writing a short story, and I apologize if there’s already a feature to do what I’m asking for, but please read this post fully to see exactly what I mean.

I actually began working in Apple’s Pages before I ran into this problem: Naming characters and places.

The “feel” of the names is very important to my story, but I obviously cannot get them all “right” on the first try. So I want to continue writing my story with “placeholder” or temporary names and then change them later, trying different spellings, combinations etc. until they all look just right to me.

I downloaded Scrivener expecting that a tool advertised for storywriters must have a feature to help with what seems to be a common problem in story writing!

So far I haven’t been able to find one, so here is my feature request/suggestion:

  • Let us define project-wide “variables” like $hero$ and $hero.hometown$

  • Those variables must be replaced with their assigned values at all times, except when an option similar to “Show Invisibles” is checked.

  • During editing, typing a $ will display a list of autocomplete suggestions for our variables.

  • Variables should only affect display and output, not any other operation like Find/Replace. So searching for $hero1$ will hit all occurrences of that variable in the text, instead of searching for occurrences of the variable’s value (e.g. not “Bilbo”).

Usage Example:

I may begin writing “In a hole in the ground there lived a $herorace$.”

I then open the Variables Inspector or what have you, and add an entry for $herorace$ = “Bobbit”

After that, my document will be displayed like “In a hole in the ground there lived a Bobbit.”

If I compile, print, share or export it any other way, it must output as Bobbit instead of $herorace$

Hmm, but wait, that doesn’t feel right. I think I’ll change $herorace$ to “Gobbit”

And so on, I’ll try different variations until I hit the right tone.

So there you have it. Please consider adding a feature like this :slight_smile: and thank you for reading.

P.S. In the future you might extend this to introduce full “programability” or “scripting” into Scrivener, which could really put this app ahead of the competition, but that’s another topic for another day.

(edited for formatting)

So… how do I (the writer) know where I typed the actual variable name if I can’t see it because it’s replaced in the editor?

I understand what you are asking, but i think the UI should only show the actual characters typed. To see the variables with full replacement value it should be post compile.

Since I don’t work for L&L in any context i’m just adding a thought to the request not indicating a formal position on it.

I addressed that in the bullet list and edited the post to make it clearer: except when an option similar to “Show Invisibles” is checked.

There could be 2 options: “Disable variables” and “Highlight variables” to see where they’re used in a document.

The ability to edit and see your document in real-time WITH the variable replacements is very important.

Think of it as dynamically changing all instances of a color or the overall hue of a digital image in tools like Photoshop.

We are painting with our words.

I want to try all combinations and see my text change in real-time. I want to see whether my story looks better with “Hobbit” versus “Halfling”, or some other fictional word. Maybe I’ll try “Gnome” heh.

I want to instantly switch back and forth between the different variations for a name until I can decide which one feels better.

Find & Replace and Compile/Export is too cumbersome for that. Replacing also has the risk of changing occurrences you did not mean to touch. For example, Bilbo may refer to himself as a Hobbit while other races call him a Halfling, so I’ll use $herorace.self$ and $herorace.common$ and so on.

You can do this during compile, as Jaysen suggested, using Replacements.
After all, Scrivener is not a wysiwyg editor so why should it show the final names?