Keyboard shortcut conflict between script elements and styles

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Wed Nov 22, 2017 9:48 pm Post

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.42.31 PM.png
Screen Shot 2017-11-22 at 4.42.31 PM.png (35.08 KiB) Viewed 3780 times
Screen Shot 2017-11-22 at 4.41.59 PM.png
Screen Shot 2017-11-22 at 4.41.59 PM.png (21.61 KiB) Viewed 3780 times


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

br
brookter
Posts: 2172
Joined: Wed Mar 18, 2009 12:22 pm
Platform: Mac

Wed Nov 22, 2017 10:03 pm Post

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.

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Wed Nov 22, 2017 10:11 pm Post

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.

User avatar
AmberV
Posts: 24325
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Wed Nov 22, 2017 10:18 pm Post

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?
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Wed Nov 22, 2017 10:56 pm Post

AmberV wrote: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. :?

User avatar
AmberV
Posts: 24325
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Wed Nov 22, 2017 11:01 pm Post

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.

Thanks!
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
KB
Site Admin
Posts: 20824
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Nov 24, 2017 11:09 am Post

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.

Thanks!
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Fri Nov 24, 2017 5:14 pm Post

KB wrote:Ah, another of the many joys of High Sierra.


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.

User avatar
KB
Site Admin
Posts: 20824
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Nov 24, 2017 6:04 pm Post

Huh, weird! Well, I guess I can't blame that one on Apple, then. :) At any rate, it should be fixed for the next update!
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Wed Jun 06, 2018 7:39 pm Post

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.

User avatar
KB
Site Admin
Posts: 20824
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed Jun 06, 2018 7:50 pm Post

I cannot reproduce this. Can you please provide the necessary steps to see the issue?
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
SarsenLintel
Posts: 458
Joined: Thu Jan 10, 2013 4:46 pm
Platform: Mac + iOS

Wed Jun 06, 2018 8:24 pm Post

Ha, I restarted Scriv and now it's not doing it. :lol:

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

User avatar
KB
Site Admin
Posts: 20824
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu Jun 07, 2018 6:44 pm Post

Weird! I suppose an error could have been thrown somewhere - let me know if you see it again!
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."