I have been trying to use a separate program AutoHotKey to setup quick shortcuts to paste different text into a new label. It does paste in the text, but for some reason the track also jumps backwards a few frames, so then I have to scroll forward two frames to get back to the label. The behavior is inconsistent, and sometimes it works properly. If I can’t get this to work, is there another way to do this? For example, I want to press Numpad1 to create a new label with text1, press Numpad2 to create a new label text2 and so forth.
Here was my AutoHotKey script:
Numpad1:: Send text1
Numpad2:: Send text2
Do you mean pasting text that you have copied from a text document, or do you mean that you would have preset text for each hot key?
If the former, you can do: “Ctrl + B” then “Ctrl + V”.
If the latter, then you could create one Nyquist plug-in for each label text.
Each plug-in would have the same form, but you would change the quoted text in the last line, and the “name”, and save each with suitable file names (ending in “.ny”)
To edit a Nyquist plug-in, you need to use a “plain text editor” such as NotePad++
The plug-in itself is very simple, just one line of code and some headers:
;type tool generate
;name "Label 1"
(list (list 0 0 "label1"))
and here it is as a plug-in:
label1.ny (91 Bytes)
When installed and enabled, the plug-in will be available in the “Tools” menu.
You can also assign a keyboard shortcut to the plug-in: Shortcuts Preferences - Audacity Manual
The plug-in will normally add a label to a new label track. If you want labels to appear in the same label track, you need to select both the audio track, and the label track.
If you want region labels rather than point labels, then you need a little bit more code:
(setf endtime (- (get '*selection* 'end)
(get '*selection* 'start)))
(list (list 0 endtime "Text"))
Thanks that seems to be working well!