Book Collection level Changes + Global Changes

The Changes feature is something we use quite a bit. But there are some changes that are good for one book collection in an app that are not good for the other collections in that app. It would be useful to be able to have global changes as well as changes for the different Book Collections - something like what we have currently for Styles - you have global styles for the whole app but then can further define styles for the individual book collections.

Yes, I agree that this would be excellent! I’m adding a vote.

I’d agree with this. I’ve been working on how to add End of Ayah verse surround for an Arabic script project. This involves a simple regex to add a Unicode character (u6DD) before the verse number, but I don’t want this to effect my other book collections. Collection-level changes would solve this problem for me.

Thank you for suggesting this new feature. Changes at a book collection level will be in the next release of Scripture App Builder.

I now see a Changes tab for the whole app, and another one for a Book Collection. However I cannot see any option for that for individual books. Is there no such option?

Yes, you are right. Changes can be made at an app or book collection level. We don’t have book-level Changes at the moment.

If you would like such a feature, please can you give an example of a situation in which it would be useful? Thanks!

I’m currently trying to work around not being able to put a cartouche around a book title.

To do this, I’m probably going to create 27 different images, and use changes to substitute each title with a figure.

I can do what I want with the app-level changes:
'\\mt1 The Gospel of Matthew' > '\\fig1 |src="cartouche_mat.png"\\fig\*

But the problem is that I’m going to have to look up the name of every book, and more importantly, if the spelling of the book ever changes my search will fail. If it were at an book level, it would be much easier.
'\\mt1 .*?\n' > '\\fig1 |src="cartouche_mat.png"\\fig\*\n

So, this is probably a request to make a particular job easier and more robust to edits to the text, but not something that I can’t work around.

I’d be afraid maintaining the same expression in 27 different places would be more difficult than keeping it all in one place. Besides, if you name your image files as in your example, you could use the book name in the \id line to select the correct figure with a regex something like this:
'\\id (\w{3})(.+?)\\mt1 .+?\n' > '\\id \1\2\\fig |src="cartouche_\1.png"\\fig\*'

This is an intriguing idea. It would be very helpful to pull the book name from the \id line, but I don’t actually want the cartouche occurring immediately in the file.

First of all, the regex in SAB doesn’t appear to treat catch line returns with ., and so I’m using [\s\S] to say “any character including new line”. Is there a better way to do it?

My trial regex used a positive lookbehind, which works, and a non-capturing group, which doesn’t work:
'(?<=\\id (\w{3}))(?:[\s\S]*?)\\mt1 (.*?)\n' > '\\fig |src="cartouche_\1.png"\\fig\*\n'
Is there something wrong with (?:[\s\S]*?)? I was expecting it to find lots of stuff between the \id and the \mt1 line, but to just ignore that stuff when it came time for find/replace. Instead it captured that stuff and then replaced them with just the \fig portion.

I was not aware that you could include a capturing group within a look behind.
Adding (?s) to the beginning of the expression should instruct RegEx that a dot matches on line breaks, enabling you to use dot instead of [\s\S], but either should work.

Instead of putting [\s\S]*? inside a non capturing group, you should capture it so that you can put it back with a \2 in your replace statement. (It’d be logical to include the [\s\S]*? inside the positive lookbehind but many RegEx engines don’t support infinite repetition inside a lookbehind, so it probably would not work.)

As it is, [\s\S]*? matches the \h and \toc lines, but then discards them since the contents are not captured.

So the expression I have now is:
'(?s)\\id (\w{3})(.+?)\\mt1 .+?\n' > '\\id \1\2\\fig |src="cartouche_\1.png"\\fig\*'

Changes at a book level will be available from Scripture App Builder 10.3, to be released soon.