tell application id "com.figure53.QLab.5"
set theWindowID to window 1
tell front workspace
set theNotes to notes of cue "?O"
if theNotes is "hidden" then
set theValue to false
set theStatus to "visible"
else
set theValue to true
set theStatus to "hidden"
end if
set notes of cue "?O" to theStatus
end tell
tell overrides
-- #######################################
-- Comment in/out what you need/don't need
-- INPUTS:
--
-- set midi input enabled to theValue
-- set msc input enabled to theValue
-- set sysex input enabled to theValue
-- set network external input enabled to theValue
-- set network local input enabled to theValue
-- set timecode input enabled to theValue
--
-- OUTPUTS:
--
set midi output enabled to theValue
set msc output enabled to theValue
set sysex output enabled to theValue
set network external output enabled to theValue
-- set network local output enabled to theValue
set timecode output enabled to theValue
set dmx output enabled to theValue
-- #######################################
-- Comment Until Figure53 fixes this, hide the OR controller if you want
--
if theValue then
set overrides visibility to false
end if
end tell
end tell
if not theValue then
tell application "System Events"
tell process "QLab"
set frontmost to true
click (first menu item whose name contains " — ") of menu "Window" of menu bar 1
end tell
end tell
end if
-- toggle the visablity of the (MIDI, Network, Timecode) Overrides window
tell application "QLab" to tell overrides
if overrides visibility then
set overrides visibility to false
else
set overrides visibility to true
end if
end tell
or if you just want to turn if off, you can do that with one line script
tell application "QLab" to tell overrides to set overrides visibility to false
put this in a group with a Network cue with the OSC
/overrides/networkExternalInputEnabled false
you could put all this in a script to create a toggle, display the overrides window briefly as a sanity check and then hide it again.
so a complete toggle solution in one script (with the network cue being created if it doesn't already exist) You could apply a similar approach with MIDI enable but don't try this with Local OSC disable!
-- toggle external network triggers, briefly showing Overrides window
set netCueNum to "netstatus"
tell application id "com.figure53.QLab.5" to tell front workspace
set nl to linefeed
try
set netCue to cue netCueNum
on error
-- if the network cue doesn't exist make it and set the cue number and patch
make type "network"
set netCue to last item of (selected as list)
set q number of netCue to netCueNum
set network patch number of netCue to 1 -- assumes network patch 1 is still the Qlab internal
end try
-- show the Overrides window
tell application "QLab" to tell overrides to set overrides visibility to true
delay 0.5
-- get the current status of external network input into the notes of the network cue
set parameter values of netCue to "/cue/" & netCueNum & "/notes #/overrides/networkExternalInputEnabled#"
start netCue
if (notes of netCue) as string is "1" then
display notification "disabled" with title "External Network triggers"
set parameter values of netCue to "/overrides/networkExternalInputEnabled false"
start netCue
else
display notification "Enabled" with title "External Network triggers"
set parameter values of netCue to "/overrides/networkExternalInputEnabled true"
start netCue
end if
-- hide the Overrides window after delay for "sanity check"
delay 1
tell application "QLab" to tell overrides to set overrides visibility to false
end tell
Hotkey 1
--toggle current overrides and return Keyboard focus to Main Cue List
tell application id "com.figure53.QLab.5"
set theMIDI to get midi output enabled of overrides
set the midi output enabled of overrides to not theMIDI
set theNetwork to get (network external output enabled of overrides)
set network external output enabled of overrides to not theNetwork
end tell
tell application "System Events" to perform action "AXRaise" of (first window of process "QLab" whose title contains "Main")
Hotkey 2
-- toggle overrides window visibility and return keyboard focus to Main Cue List
tell application id "com.figure53.QLab.5"
set the overrides visibility of overrides to not (overrides visibility of overrides)
end tell
tell application "System Events" to perform action "AXRaise" of (first window of process "QLab" whose title contains "Main")
No, it is possible to toggle the network input on/off, my script in above answer does this. It uses an indirect method to get the current state of the network input because you cannot read that parameter directly in AppleScript. But you can access the status via OSC, and you can put the result of an #osc# query into the Notes of a cue, which you can then read via AppleScript. Depending on the result you can then turn on or off depending on the result - the main if then ... else of my script.
tell application id "com.figure53.QLab.5"
get the network external input enabled of overrides
end tell
-- toggle external network input
tell application id "com.figure53.QLab.5"
-- get the status of the network external input
set neis to get network external input enabled of overrides
if neis then
set network external input enabled of overrides to false
-- leave the overrides window open if input is disabled
tell overrides to set overrides visibility to true
else
set network external input enabled of overrides to true
-- close the overrides window after pause
delay 1
tell overrides to set overrides visibility to false
end if
end tell