To start the script, press Ctrl + Shift + T.
In the script the reloading of the Theme starts with the command: ^+t::
After that, the focus should change from your Editor to the Explorer window, and Scrivener should close and start again.
You can update the keystrokes to start the script inside the script if you want. Use the command with the following arguments: ^ = control, + = shift, and ! = alt, followed by a lowercase letter and two colons.
Replace the CAPITALIZED text inside the script with the values for your computer and Theme:
- USERNAME: Your Windows User Name for use in file paths.
- WORKINGDIR: The folder with your Theme. Don’t end with a backslash.
- EDITORWINDOWTITLE: The title of your Editor in the title bar when running.
- EXPLORERWINDOWTITLE: The title of your Explorer in the title bar when running.
- THEMENAME: The name of your Theme, without any spaces.
- TESTPROJECTNAME: The name of the Scrivener Project you use to see your Theme, without the extension
- TESTPROJECTPATH: The file path to your test project. Don’t end with a backslash.
When all this is correct, there are still many possibilities why a script doesn’t work. Uncomment the MsgBox statements to gather what’s happening and repair where necessary.
Yes, you can from the moment Scrivener is actually restarting, showing its logo in the middle of the screen. You will have to activate Scrivener when it’s loaded, so the script can end with the comment that it’s done.
Before that moment it’s best to leave AutoHotKey to it, or you will interrupt and slow down restarting of the program.
Uncomment the MsgBox statements by removing the semicolon before the line. When running the script, the message box will show up and state the action that’s executed next.
Note where the script fails and repair it when necessary.
Yes, you can. Adapt it to any situation that works for you. The script is meant as a tool to speed up Scrivener Theme development.
You could remove the “; close any application dialogs” block for example, because Scrivener is closing those dialogs and windows anyway.
Or you could remove the “Predefined Themes variables and loop” if you won’t use that feature of the script.
If you need to adapt the script to you situation, you are welcome to do so. When your changes are applicable to other users, it would be nice to share your adaption.
You can add the code to open any application dialog or window in Scrivener. Just follow the existing code and add the correct Window Title. Beware that Dialogs are closed differently than Windows and add your window to the correct list. After you’ve opened a Dialog or Window, don’t forget to add the option to also close it.
After editing the Script, don’t forget to Run it afresh from its context menu, or the former version in memory will execute again.