Automatically change parts of chapter/scene titles

Sooooo, I just noticed that I neglected to make an extra folder for Chapter 4 of my 30+ Chapter story (it was appended as Scene 27 through 29 to Chapter 3).
Since I use an ‘01 - Chapter Title, 01/01 Scene Title; 02 - Chapter Title, 02/01 Scene Title’ scheme to structure my stuff, and there are numerous Chapters with 20+ Scenes, the prospect of having to manually change all those numberings is, to say the least, annoying as all effing hell.

I already tried to use Search/Replace but the Replace function isn’t available for neither the Outline View, nor the Corkboard View.

Please please, is there a way for me to go through this at least semi-automatically and replace Chapter numbers? Some dirty trick or workaround? I’m gonna seriously cry if I have to click my way through this and I do not accept the failure of having two Chapter 04s.

Btw. while looking for a post on this questions I stumbled across a lot of cool Scrivener features that I didn’t even know about. Very exciting!

They may end up being another deluge of new features. :slight_smile:

The Edit/Find/Project Replace… command is more appropriate to what you are trying to do, but it should be noted that precisely what you are trying to do is not possible to automate since you can only specify one replacement value. While you could use the “RegEx” search option to locate and strip out just the numerals and hyphen, this would not give you a new sequential list of numbers. One thing you could do is replace all of them with <$n>, which is a Scrivener code for a simple numerical counter—keeping in mind you’re going to have to stare at that code in your folder names from this point on.

Or and even better approach, with that counter in mind, you might save yourself a bunch of time by doing just what I described: strip out the numbers and hyphen entirely from all of the titles, leaving only its name. Then go into the Formatting compile option pane, click on the folder icon at the top, then the Section Layout button, and add the counter code there, including the space-hyphen-space after it if you want. Then once you have confirmed that setting, click the “Title” checkbox in the folder’s row (if necessary) to print the remainder of the folder name after each number—style the below preview as you will.

(Alternatively, if you’ve never messed with compile settings before, try a simple preset like “Standard Manuscript Format”) and take a look at its Formatting pane settings. You can examine the codes it uses in the prefix for folders, and change the formatting right in the preview area.

By the way, the search code for stripping out numbers and the hyphen like you have them would be:

^\d+\s-\s

You will want the “Use RegEx” flag enabled, and most likely every other checkbox disabled, save for the “Titles” checkbox. You could pre-select only the folders you want to strip the numbers from, and use the respective checkbox in the middle. (I would also take a moment to use the File/Back Up/Back Up To…) menu command before using Project Replace, especially with regular expressions, as one inadvertent typo could turn everything to mush. 8)

That won’t do anything for the scenes though! Generally speaking Scrivener doesn’t do a whole lot of numbering in the main writing area—for the simple reason that it has a lot of really powerful tools for applying numbers during compile. So that “limitation”, if you will, is something to keep in mind for the future in your naming conventions. Sticking with more descriptive names for scenes instead of binding them to a fixed chapter sequence will keep things more flexible—and you can always add the numbers in when you compile, if you do want them for proofing notes or what have you.

Let me know if any of those options sound reasonable, and if you need any help in finding anything, as I’ve just covered the options here without going into much detail.

Hi AmberV,

thanks for your reply!

I know the numbers are an unwieldy way of naming scenes and I’ve had my fair share of mass renamings. Maybe I should really switch to something more descriptive as you suggest. But somehow the numbers are calming. They give me a sense of structure and control.

I guess I’ll try the ‘Project replace…’ thing for now and see how that works out. I’d need it either way, regardless if I stick with numbers or switch away from them.
I’ll come back here if I have more questions.

Thanks also for the info about placeholders in the compiling stuffamajing. I’m slowly building an understanding of how that all works - thankfully I haven’t had to use it yet.

EDIT: It worked!!! I had to figure out to tell Scriv to not only replace complete words, but then it worked perfectly! Thanks so much! :slight_smile:

Well that certainly cannot be undervalued, if numbering works best for the creativity, then do carry on—that’s what using Scrivener is all about after all. :slight_smile: I just wanted to make sure you were aware of the options. So if you want to use project replace to ease half of the job, you probably don’t want to strip out the hyphen, here is a better search code for that:

^\d+

That will leave the space-hyphen-space bit in place. All that code does is check from one or more digits (\d) at the beginning of the line, and keep matching digits until it runs into something that isn’t one (like a space, or a backslash, meaning you clean the chapter number part out of your scene titles, without erasing the slash-scene# part).

Since you do mention have 20+ scenes per chapter, then consider the selection capability I mentioned. You could select all of the scenes for chapter 18 in your Binder, then use the following settings to change “17/01 - something”, “17/02 - something” (and so on) to “18/01 - something” and “18/02 - something”.


Since this panel remembers its settings between uses, and all you would need to change between scene file selecting is the chapter number, you could clean these up fairly quickly.

Update: Oops, I see you’ve sorted it out already. Well, hopefully these notes will be useful to you for the next time! :wink: