Updated November 2023.
One of the most labor-intensive tasks in QLab is creating a cue list for a lot of very similar cues, which vary only in their content. If you are doing a show in which you want to add subtitles (or supertitles or captions) to other video content using the same displays, you may have to program thousands of cues. Wouldn't it be great to just have all the subtitles in a text file, hit one button, and before you have time to make a cup of coffee, have a performance-ready workspace automatically generated?
In this example, you need a plain text document with each of your titles on its own line. Open the example QLab workspace and your text file, press ⌃S (control-S), and the process begins.
Here is a screen recording of a solution in action. Best viewed full screen.
The scripts in this chapter were written for QLab 5. With a few alterations, however, they can work in QLab 3 and QLab 4 as well The edits required are listed at the end of the article.
The workspace uses three Script cues in a Group cue. The Script cues are contained in a separate cue list in the workspace.
The Script cue numbered "TITLES" imports the paragraphs of the text document into Text cues, using the font style set in Workspace Settings → Templates → Cue Templates. The script counts the number of paragraphs in the text document and then creates one Text cue for each paragraph, setting the text and the cue name of each cue to the imported text.
When each paragraph of your text file is read in, it is examined to see if it contains any forward slash ( / ) symbols. If it finds any, it adds a return before the next item of text. It does this by setting the text delimiters to the forward slash temporarily. Using this method, if your text file contains:
Subtitle 1/Subtitle2/Subtitle3/subtitle4
that will be rendered in a Text cue as:

Loading...
The Script cue numbered "MAKE" generates a Group cue that fades the old title and starts the new title and fades it in. Rich Walsh contributed several improvements to the first version of this.
At the top of the script are some variables you can edit to set the timing of the cues.
Loading...
The Script cue numbered "NUMB" cleans up the numbering, numbering all the generated Group cues sequentially.
Loading...
To make these scripts work with earlier versions of QLab:
tell application id "com.figure53.qlab.5" to tell front workspace to tell application id "com.figure53.qlab.4" or application id "com.figure53.qlab.3"type "Text" to type "Titles"set mode of groupCue to timeline to set mode of groupCue to fire_allThese adaptations have been made in the downloadable examples for QLab 3 and 4.