There appears to be a lag between i) the moment you invoke a Style (via its associated key command) and ii) the moment when the associated menu item registers as selected (checkmark).
Not sure this is something under developer control, but in my use case it would be a virtue if this lag could be minimized. Perhaps this is a matter of calling a routine to log the selection before doing the time consuming work of actually applying the style - or whatever?
My use case where this lag matters is no doubt unusual, but I thought I would put this wish out there nonetheless.
BACKGROUND:
Here is why it matters (and how I discovered it):
I use in-document outlining a lot. I have defined 10 styles which give me different levels of indent (Heading 1, Heading 2, etc) and that incidentally match my settings in Word for these. I have assigned key commands to all of them. And this works pretty much, but still requires hitting different command keys for each different level – which is not great.
The one function I am still missing from Word’s outline functionality is Promote/Demote. Scrivener’s promote/demote function does not do for me, because it is styleless. So, I have set up two macros with my key macro software which work perfectly to shift the style of a paragraph among my Heading N styles.
EXCEPT to work in this way often involves you in hitting the promote or demote key command multiple times in succession. Because of the lag reported above, the macro often misfires – it does not detect the just applied Style, because the menu item is not yet registered as selected (which is how this macro works).
Is this something you are seeing from 10.15? I’m working from 10.14 here, and not really seeing much lag to speak of. I’m looking mainly at the ⇧⌘Y shortcut, as well as the Format Bar. If I press ⌥⌘8 to select a style, it shows up in the Format Bar instantly, and if I immediately follow up with the shortcut to open the selection menu, it is always already selected.
But I’m not trying what you are, that is chaining multiple if/then/elses together into a macro to have successive styles selected.
I am still holding pat on 10.13.6. (Should have mentioned). So, with luck it will turn out to be something that resolves when I am forced to upgrade when my new laptop arrives?
I do not have any real way to confirm the lag directly. It would be a lag that showed up between two runs of a macro separated only by the second hitting of the keystroke shortcut. So, no peeking at the menu would be revealing as a test.
What the quick running of the macro in rapid succession suggests is that there is some appreciable time when the style item that was checked on the menu becomes unchecked and before the newly applied style item becomes checked. If the second macro call runs in this interval, it will fail (in the sense of producing the result you get if none of the Heading N styles is checked).
So the question becomes whether Scrivener is conducting other business between those two function calls (uncheck and check).
I wrote in the off chance that when someone next drove by that bit of code, they might think, “Hey yeah I sooo was not thinking about that as a priority I totally slipped these other routine calls in between, and there is no reason these two could not executed together reversed.”
I guess ideally (for me) the Promote/Demote functions could actually be tied to a specific sequence of Styles. But I figured wishing for what might just turn out to be an optimization was a humbler request!