Programmable key sequences for typing text repeatedly

As I’m writing a play, I need to repeatedly type each protagonist’s name before each element of dialogue, and as some are over ten characters in length, it’s become a bit tedious and distracting. Having a background in computing, I decided to spend some time investigating ways of getting my Win 10 PC to help me with this boring task, and came up with two helpful solutions which I thought I’d pass on.

The first trick I found was that Win 10 contains a keyboard sequence, , which gives you access to the clipboard. Once the list of the last few things you copied appears, you can select in and then paste it. As a solution it’s simple and does the job, but I wondered if there wasn’t a slicker solution, so carried on digging until I found AutoHotkey.

AutoHotkey is a free scripting tool which enables you define sequences of keystrokes which when typed, do something else, such as type in some text. The program is quite potentially very sophisticated, but I don’t need most of its advanced features for it to be very useful indeed. It takes a little effort to learn how to use it, but that effort is well rewarded by the amount of time it saves.

The program looks at the content of a text file for instructions. In my case, my file currently contains this (don’t be put off by its geeky appearance: the syntax is so simple that anybody can understand it):

::O@::
Send, FirstCharacterName
Return

::T@::
Send, SecondCharacterName
Return

What this means is that when I type ‘T@’ and press return, the text ‘SecondCharacterName’ is typed in for me. Typing ‘O@’ means that the text ‘FirstCharacterName’ is typed in. The typing can be into any software: Scrivener, Word, Excel - any program where the cursor is currently located. It not only saves time, but it helps me concentrate better on the dialogue rather than the necessary surrounding text. As I’m so delighted with it, I thought I should pass it on to any other Scrivener users who find themselves in the same situation.

Hmm…
Not that it ain’t interesting, but how about simply using Scrivener’s auto-complete functions ?

Why not use Scrivener’s scriptwriting featgure? Create a new project and select either Stage Play (UK) or Stage Play (US). It will impliticly turn on the auto-complete feature making it easier to type character names and give you guided control of the relevant elements that a script has. And if you want to skip an element has short-cut keys available.

1 Like

In fact, in Scriptwriting mode, you get a specialized auto-complete that is specific to your character names. Scriv catalogs the character names you use in the Character field, and then suggests them back whenever you start typing in further Character fields. So, if you have a character named Andy and start typing in a Character field, Scriv does not suggest ‘and’ as a completion, but ‘Andy’. It also knows things like “names should be in all caps”, if that is how the scrript format you are using does it.

1 Like

Not only that, but once you are used to it (to your own auto-complete list) and know what name is gonna be suggested, you may simply hit enter without even looking.

You’d type the first two letter (for e.g.) then enter. Just like that.

aa-enter → AARON
mi-enter → MICHELLE
z-enter → ZACHARY
etc etc

Yes, scriptwriting mode auto-all-caps character’s names if told to.

It is all here :
image

Script mode is per document.
No need to create a new project, in the sense that a project can host script mode files as well as standard text mode documents.

You can even revert the document back to standard text mode afterwards, and it’ll keep the formatting created using script mode.