QLab, AppleScript, and Timecode window

170 views
Skip to first unread message

Tim Rogers

unread,
Oct 26, 2015, 11:20:05 PM10/26/15
to QLab
Is there a way to ask an AppleScript script - other than by doing something like this - 

tell application "System Events" to tell process "QLab"
click menu item "Timecode" of menu "Window" of menu bar 1
set frontmost to true
end tell

to activate the "Timecode" window in Qlab 3?

Thank you!


micpool

unread,
Oct 26, 2015, 11:29:59 PM10/26/15
to QLab
If that achieves what you want , why do you want something else?

Mic

Tim Rogers

unread,
Oct 26, 2015, 11:34:24 PM10/26/15
to QLab
I'd rather not have to activate the option to allow it in Accessibility if I don't have to. One more thing to remember to do - or to explain to someone else if they want to use the script. 

I'm just getting started with AppleScript. I assumed that there was a QLab-specific way to do this - although I couldn't find it in the "QLab Suite" Library. 

Thanks for the reply.


--
--
Change your preferences or unsubscribe here:
http://groups.google.com/group/qlab
 
Follow Figure 53 on Twitter: http://twitter.com/Figure53

---
You received this message because you are subscribed to a topic in the Google Groups "QLab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qlab/z88vcO_a4BA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qlab+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rich Walsh

unread,
Oct 27, 2015, 5:29:37 AM10/27/15
to ql...@googlegroups.com
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
click menu item "Timecode" of menu "Window" of menu bar 1
end if
end tell
else
-- ###FIXME### Tell the user that UI scripting needs to be turned on and how (OS-specific)
end if
end tell

Rich

Tim Rogers

unread,
Oct 27, 2015, 6:57:43 PM10/27/15
to ql...@googlegroups.com
Bah. This seems unreasonably complex! :)

I don't mind complicated programming for complicated tasks - but it seems silly to me that you need to do this to open a window. Especially if even after all of this, it isn't reliable! That is why I was hoping for a QLab-specific hook for this.

But I appreciate you for taking the time to explain this to me.

At this point, I likely will continue to use the old Timecode application that Figure 53 released. I am able to script activating and closing it easily enough, and it works for me. I had just thought that using the built-in Timecode window in QLab 3 would be more elegant. Perhaps not.


Reply all
Reply to author
Forward
0 new messages