Repeating text documents

I don’t think I’ve ever seen anyone ask this question before…

I have a project that has lots of repeating text documents. It’s a stage MC script, where certain announcements are repeated at the beginning of each act. Scrivener is great because I can put each block of text in a separate document, copy and drag them to the next occurrence. However, if something changes, I have to to modify each document individually.

Search and Replace does not seem to work with large blocks of text.

Does anyone have a solution for replace repeating blocks of text or repeating text documents?

Hello dgreencr;

Do you need them there in the in the editing stage or will having be printed, on either virtual paper or real cellulose fibers. How big are these Text Blocks? One liners or several pages? Can you break the into one liners?

Here is my thought. You create a word up to sub for one of them, Say “MC4751Right” like that is going to come up in conversation. (with my luck it is the name of a newly discovered star in your play.)
Now go into the Compiler and into Replacements. Hit the + in the lower Right. Put the Name of the Star in the Replace box. then in the With Box put the text you want to replace it with. Check Whole word and match Case. (Less Chance of Errors)

Now lets test this. in my Text File I write, “Have you see MC4751Right”

When I compile that document I get:
“Have you see At ipsum vitae est lacinia tincidunt. Maecenas elit orci,gravida ut, molestie non, venenatis vel, lorem. Sedlacinia. Suspendisse potenti. Sed ultricies cursuslectus. In id magna sit amet nibh suspicit euismod.Integer enim. Donec sapien ante, accumsan ut,sodales commodo, auctor quis, lacus. Maecenas a elitlacinia urna posuere sodales. Curabitur pede pede,molestie id, blandit vitae, varius ac, purus. Mauris atipsum vitae est lacinia tincidunt. Maecenas elit orci, gravida ut, molestie non, venenatis vel,lorem. Sed lacinia. Suspendisse potenti. Sed ultrucies cursus lectus. In id magna sit amet nibhsuspicit euismod. Integer enim. Donec sapien ante, accumsan ut, sodales commodo, auctorquis, lacus. Maecenas a elit lacinia urna posuere sodales. Curabitur pede pede, molestie id,blandit vitae, varius ac, purus?”

Does that help?
Bob

BTW the box is much like a Tardis, it is Larger on the inside that it appears to be.

If you dragged and dropped them into place the first time why can’t you do the same now? Modify/update the first one then drag it and drop it into place elsewhere in the Binder.

Thank you both for your replies! My text is too long for search and replace, but that’s an interesting hack, Bob.

Hello

Search and Replace will work for long sections of text: I’ve just tested it with “replace” blocks of text of 2600 words in length.

However, if a minor change is made to the text being searched for (even an additional space or paragraph return), then the search understandably fails.

The way around this is to create a simple but unique search string and use that as a placeholder text.

For example, I just created four documents with a placeholder text of A1B2C3 (you could use anything you want, so long as it is unique). I then created a block of text of 2672 words in length.

I searched for A1B2C3 and replaced it with the block of text. It worked perfectly.

So in your case, create a simple placeholder text where you know you will be using the repeated text. (If you have lots of different repeated blocks, create lots of unique placeholders.) When you have settled on the final edited wording for your text, just search for the placeholders and replace them with the long block of text. I don’t know if there is a limit. (Seems like a challenge…so I just tried it with a block of text over 15,000 words in length and that worked perfectly. Your text is longer than that?)

Hope this helps. The real problem with S&R is usually with minor discrepancies in the search string.

I think another problem with S&R is that you only get one shot at replacement. Document linking is the rule in word processors and would not be a bad feature for Scrivener, but it’s probably rarely needed. Scrivener builds the compiled document out of assembled fragments anyway. I’d say if you make a document with the text that’s likely to repeat, best to give it a unique icon or color identifier and then replicate it as necessary. But use a different livery if there’s ever need to update the batch, to be confident you’ve placed the latest version all around.

One thing I have planned is the ability to add a <$text> placeholder. You would add a Scrivener link to this, linking to another text document, and this would get replaced by the contents of that document during Compile. That should address this need, if I understand it correctly. This won’t make it in for a little while, but it is on the list for the next Compile overhaul.

All the best,
Keith

Agreed. If doing a major S&R or one that might need to be changed in the future, it makes sense to duplicate the master file.

That said, OS X can handle large S&Rs, so long as the user hasn’t edited the repeated segments in a way that makes them different to each other.

Perfect for boilerplate texts and similar. Very nice!

This feature

One thing I have planned is the ability to add a <$text> placeholder. You would add a Scrivener link to this, linking to another text document, and this would get replaced by the contents of that document during Compile.

Would be really useful to me. I want to be able to repeat key sentences in a case for support, and to repeat slides in a presentation.

Has it come into being yet?

Could one implement a rough version of it using compile time replacements to swap fairly long text strings for placeholders?

Andrew