Compile Replacements - how to copy/move?

(Ignore the content of the Formats list: it’s a long story.)

Scrivener 3.1.5.1; Windows 10, 64-bit. Manual 3.1.0, section 23.4.4.

Before I was marginally less ignorant about compile, I set up some compile replacements via a Format (red arrow). Since I want the replacements to be project replacements (blue arrow) and there are rather more than shown, is there an “easy” way to transfer the replacements from the Format to the project? (XML editing is acceptable to me.)

(I don’t suppose there’s an export/import facility for these on their own, is there?)

The replacements you put into the format are stored in the format file, typically in C:\Users\YourUserName\AppData\Local\LiteratureAndLatte\Scrivener\Compile Formats, and the XML of the format file contains the replacements, such as:

<Replacements>
        <Replacement WholeWord="Yes">
            <Replace><![CDATA[test6]]></Replace>
            <With><![CDATA[test6a]]></With>
        </Replacement>
</Replacements>

The project replacements, also specified from the Compile screen (see the user manual section 23.4.4) are also stored in an XML file, but the file is Compile.xml which is stored in the Settings subfolder of the project’s .scriv folder.

The XML format of both seems to be identical, so you could try moving the XML block from one file to another. BUT – make sure you close the project and make backups of any file you are going to change so you can get back to where you started if something goes wrong.

1 Like

Yup, copying them over between the Format’s XML file and your general compile settings XML is the only way at the moment. There is supposed to be a much easier way of doing this (simple copy and paste that even works outside of Scrivener, such that I could share replacement settings with you in a code block here), but it’s not programmed yet.

Perfect! I shall try that; thank you.

Replacements successful moved.

Note: if no replacements already exist for the project, you must either

  1. Create a dummy replacement item AND COMPILE (if you don’t compile, the addition is thrown away on Cancel), then search for the resulting entry in Compile.xml and paste in entries as required, or

UPDATE Or press “Alt” to change the button labels and functions! Who knew? (see answer below)

  1. Place the <Replacements>… </Replacements> section after </Content> in Compile.xml (or, at the very least at the same level with <ProjectSettings> and then paste the entries inside.

Illustration of Compile.xml (as seen in Notepad++, with xml colouration)

1 Like

Create a dummy replacement item AND COMPILE (if you don’t compile, the addition is thrown away on Cancel)…

On the Compile screen, if you press and hold the Alt key, the “Compile” button changes to “Save” and the “Cancel” button changes to “Reset,” so you can save your changes without having to compile. Just hold the Alt key down and click the Save button.

1 Like

Well, I would never have guessed that! Must confess, I am not a fan of UI designs that give no clue there are other things one can do.

But, now I know. Thanks!

Agreed. In the software I write, I try to make it obvious, but when that is not possible or would be too clumsy, I provide a tooltip describing the option by hovering the mouse over the button.

As Julian-the Software-Destroyer (part time professionally, and generally by talent) I am incredibly impressed by Scrivener’s robustness, that said, the feeling that one has to complete a full apprenticeship before getting the most out of it is – after a couple of years of daily use – a bit dispiriting some days.

In this case, a simple bit of text to say “Press Alt for further options” (near the buttons) would have be enough; I just need a clue.

I think I have recently received Compile insight… time will tell :wink:

1 Like

1 Like

Indeed! I felt slightly stupid for a moment, but then discovered you have to put the cursor over the button and keep it still for a whole second. Why would I ever do that?

This is the problem with “modern” UI design, secret features that only become apparent if you do exactly the right thing for the right length of time.

If I want to Compile or Cancel I would probably put the cursor over the button and click within a quarter of a second - that’s nearly forty years of muscle-mouse-memory and hand-eye coordination at work :slight_smile:

My point stands – a static label would be better: it does not require intimate knowledge of the workings of the cosmos to understand what one needs to do :smiley:

I’d rather not have a screen flooded with information. It’s untidy and not in keeping with Windows standards.

1 Like

Agreed, but that may in part be because you already know this information, and I wouldn’t have called key information such as this a “flood” or necessarily “untidy”.

Given the problem I identified, can you propose a UI improvement that would help people in the same situation as me, without irritating people in the same situation as you?

For example, since there is room: always show all four buttons.

1 Like

I have no interest in seeing this item improved. One of the rules of the forum is that they don’t appreciate users lobbying ideas in the hope that the developers will bow to the pressure of a select group.
Where I believe there is room for an improvement I will offer a suggestion and leave it to the development team to decide if it supports their overall philosophy or not.
I wouldn’t know whether this item is in the user manual either, but where’s the fun in looking for shortcuts when there a treasure trove of interesting features to discover through trial and error.
My approach is I need to do x, is it available, yay, nay or okay that’s cool.

1 Like

I’m sure they don’t, and I’ll join in with the deprecation if I see it happening. There are many other things that don’t sit well in such places; we should all aim to maintain the quality of discussion. Well said.