when I compile for markdown, it asks every time the name of the file , and to authorize the replacement.
This is annoying as I do quick release cycles, and I have not found any option to disable this “do you want to replace ?” ( and ideally to bypass the filename). Could you help ? I would be surprised there is not quicker way …
Try turning on full keyboard access in the Keyboard : Keyboard Shortcuts system preference pane. This will automatically select secondary buttons in alert dialogue boxes, allowing you to hit the spacebar to select it, instead of having to use the mouse. I do this all of the time as well, and this keyboard sequence compiles and overwrites a file:
- Opt-Cmd-E (to load Compile).
- Enter (might be Fn-Return if you’re on a compact keyboard) to activate the Compile button.
- Enter/Return to confirm path and filename selection.
- Spacebar to activate the secondary button “Replace”
- Drink some tea and wait for compile to finish.
I have this sequence as wired in my brain as tying my shoes and have no complaints with it. The nice thing about full keyboard access is that it opens up most of these dialogue boxes to a three-key access system with enter, spacebar and esc. You’ll rarely need to use the mouse to interact with dialogue boxes.
It works !
Many thanks for the tip ! most probably useful somewhere else too !!
Slightly Off Topic,
But, as an alternative, I tried and find if there is automator or applescript support, but haven’t found.
Could you confirm positively there is none ?
The program you are looking for is Keyboard Maestro! Very useful utility for all manner of things. I’d never thought of automating this, since as I say I just have it wired in my head—but since you bring it up, I gave it a shot and the following formula works great:
- Trigger: The Hot Key
Shift-Opt-Cmd-E
is pressed. - Will execute the following actions:
- Select ‘Compile…’ in the menu ‘File’ in Scrivener.app
- Type the Enter keystroke.
- Type the Enter keystroke.
- Pause Until Any Conditions Met:
- Button with name ‘Replace’ exists.
- Menu with name ‘Compile…’ is enabled.
- Press button ‘Replace’
And that’s it. One keystroke will compile and overwrite the previously used path and filename. I have attached the macro for anyone that wants it. On a slower computer it may need another pause in between the two Enter keystrokes, but probably not since keyboard events are buffered until they can be used; you can press them faster than the computer can keep up with them, in other words. Just be careful to use either a timed pause, or one that has a fallback condition like the example, which bails out of the script if the Compile menu command is active (and thus the Compile sheet is no longer open). Otherwise it just hangs forever waiting for the Replace button to appear, and might fire off at a moment you wouldn’t expect it to, while doing something else that requests confirmation.
km_macro-compile_and_replace.tar.gz (1.05 KB)