This adds the ability to work with video cues as well as audio to the Cookbook Script FADE NINJA
--This script will make a fade in cue of an audio or video cue in a timeline group with its target, and a fade out cue below the group for you to move to the position in the cuelist you want the cue to fade out.
set inDuration to 5 --set fade in duration here
set outDuration to 10 --set fade in duration here
set minVolume to -60 --Set to match minimum volume set in settings/general
tell application id "com.figure53.QLab.4" to tell front workspace
try
set thecue to last item of (selected as list)
set q number of thecue to ""
if q type of thecue is "Audio" or q type of thecue is "video" then
make type "Fade"
set fadeOutCue to last item of (selected as list)
set the q number of fadeOutCue to ""
set cue target of fadeOutCue to thecue
set duration of fadeOutCue to outDuration
set stop target when done of fadeOutCue to true
set q name of fadeOutCue to "Fade out " & q list name of thecue & " (" & outDuration & "s)"
set audioCueLevel to thecue getLevel row 0 column 0
if q type of thecue is "video" then
set thecueopacity to the opacity of thecue
set the opacity of fadeOutCue to 0
set the do opacity of fadeOutCue to true
end if
fadeOutCue setLevel row 0 column 0 db minVolume
moveSelectionUp
make type "Fade"
set fadeCue to last item of (selected as list)
set q number of fadeCue to ""
set cue target of fadeCue to thecue
set duration of fadeCue to inDuration
fadeCue setLevel row 0 column 0 db audioCueLevel
thecue setLevel row 0 column 0 db minVolume
if q type of thecue is "video" then
set the opacity of fadeCue to thecueopacity
set the opacity of thecue to 0
set the do opacity of fadeCue to true
end if
set cuesToGroup to {thecue, fadeCue}
make type "Group"
set groupCue to last item of (selected as list)
set mode of groupCue to fire_all
set q name of groupCue to "Fade in " & q list name of thecue & " (" & inDuration & "s)"
repeat with eachCue in cuesToGroup
set eachCueID to uniqueID of eachCue
move cue id eachCueID of parent of eachCue to end of groupCue
end repeat
end if
end try
end tell
Mic