If you're going to be scripting QLab a lot you're going to need to enable UI scripting (or whatever Apple are calling it in this month's OS). The majority of the interface is scriptable through UI scripting, so what would be the point of Figure 53 adding specific hooks to do exactly the same thing? There's a fairly standard preflight check in UI scripts that will tell you if they're going to fail and why:
UI elements enabled; it probably needs updating for Scafell Pike.
I played around with opening the Timecode window like this back in April and abandoned it as it was entirely unpredictable as to which Timecode window was going to open: with multiple cuelists – only one of which was set to receive TC – I didn't always get a window connected to the correct cuelist…
I would avoid ever using "QLab" in a script as you don't know what it's going to be called if QLab 2 & 3 (or 3 & 4, eventually) are both present; better to use:
first application process whose bundle identifier is "com.figure53.QLab.3"
What do you think the last line does? Do you want to activate QLab (which it does) or bring the TC window frontmost?
Your script also toggles the window if you run it again, so you may want to check if the window is already open:
-- This script needs to be run in a separate process if run from within QLab, as otherwise it will lock up QLab and prevent it responding
tell application "System Events"
if UI elements enabled then
tell (first application process whose bundle identifier is "com.figure53.QLab.3")
if (count (windows whose name begins with "Incoming")) = 0 then