Keyboard shortcut conflict between script elements and styles

Something odd - the keyboard shortcuts are inconsistent. Seems they’re assigned to both script elements and to styles.

Screen Shot 2017-11-22 at 4.41.59 PM.pngScreen Shot 2017-11-22 at 4.42.31 PM.png

They also seem to flip back and forth randomly which regards to which command the shortcut will actually execute.

Isn’t that because you can’t use Script Elements in ordinary documents, and you can’t use Styles in Screenwriting documents, so there’s no clash?

In effect, they’re doing the same thing (formatting a lump of text with a style) they just operate in different domains, so there’s no clash in practice.

Or at least I’ve not found a clash using both. I select a paragraph in a document, use cmd-opt-1 to set a heading, then cmd-8 to turn it to a screenwriting document and cmd-opt-1 reformats the paragraph to Scene Heading as I’d expect. cmd-8 again and cmd-opt-1 is Heading 1 again.

That makes sense, except (at least in my case) they’re not playing nice about it and are switching within the same document.

I start up a project with a document in script mode,
I look at the Format menu and see that the shortcuts are assigned to script elements.
Do nothing. look back at the Format menu a moment later and the shortcuts are now assigned to Styles.

Are there any other indications that scripting itself is toggling? Is the icon shifting, the footer bar elements? That’s a really weird one—do you think the delay corresponds to auto-save?

No changes in the icon or footer bar. In the process of testing the auto-save that I noticed that changes to the interval weren’t taking effect so I rebooted.

That appeared to do the trick. So I was typing up a message to that effect, but then I went back to Scriv to double check and it had happened again. :cry:

I tested a bit more and it appears that it happens whenever I give focus to a different app (so far I’ve tested Mail, TextEdit, and Firefox), and then switch back to Scriv - but only if I click back into the Scriv window, if I Alt+Tab back, or click the dock icon it’s fine. :confused:

Ah! There we go; that was the trick. Clicking out of the software into the browser and back again did it for me. When I pressed Opt-Cmd-1 I got the styling settings for the default “Centered Text” style instead of the Scene Heading element.


Ah, another of the many joys of High Sierra. Scrivener updates those keyboard shortcuts to be assigned either to styles or script elements depending on the currently-focussed document. It checks the when the window comes to the foreground, too. In all previous versions of macOS, checking this sort of thing in the “window did enter foreground” message was reliable. In macOS 10.13, it’s no longer reliable as things may not yet have been set up (there are exceptions that can be thrown if you try certain things in this code now, too). You have to force the checks to the end of the run loop… Which I’ve done for the next update to work around this mess.


Glad to help, but just for the record I’m seeing this on Sierra (10.12.6), I haven’t updated to High Sierra yet.

Huh, weird! Well, I guess I can’t blame that one on Apple, then. :slight_smile: At any rate, it should be fixed for the next update!

Quick update to this - the fix seems to have worked in the main scrivener window. But today I decided to work in Composition mode for the first time in ages and I’m seeing the same sort of behaviour. (3.0.2 / 10.12.6)

In the main Scrivener window, the shortcuts are assigned to Scriptwriting | Change element to…
But when I change to Composition Mode they’re assigned to the Styles options.
If I click into the text and then Alt-Tab away from Scriv and then come back, then shortcuts change back to the Scriptwriting options again.
If I Alt-Tab away and then come back without first clicking into the text then the shortcuts do not change.

I cannot reproduce this. Can you please provide the necessary steps to see the issue?

Ha, I restarted Scriv and now it’s not doing it. :laughing:

I’ll keep an eye on it to see if I can figure out what I did to cause that earlier. :question:

Weird! I suppose an error could have been thrown somewhere - let me know if you see it again!