tell application id "com.figure53.qlab.3" to tell front workspace
set thecues to cues
set thetext to ""
display dialog "Please enter text to find" default answer thetext
set thetext to text returned of result
try
repeat with thiscue in thecues
if q name of thiscue contains thetext then
set current cue list to parent of thiscue
delay 0.1
set playback position of current cue list to thiscue
exit repeat
end if
end repeat
end try
end tell
Mic
And if you aren't using flags for anything else (It will reset all flags) you can find all occurences of cues containing the search text in their names by setting the flags on them.
You can then see all the found (flagged) cues across the multiple list in the warnings window (accessed by clicking the warning triangle in the bottom right of the workspace)
tell application id "com.figure53.qlab.3" to tell front workspace
set thecues to cues
set thetext to ""
display dialog "Please enter text to find" default answer thetext
set thetext to text returned of result
try
repeat with thiscue in thecues
set the flagged of thiscue to false
if q name of thiscue contains thetext then
set the flagged of thiscue to true
end if
end repeat
end try
end tell
Mic
-- Declarationsglobal dialogTitleset dialogTitle to "Navigate cues whose Cue Name contains…"-- Main routinetell front workspace
try -- This protects against no selection (can't get last item of (selected as list))set selectedCue to last item of (selected as list)on errorset selectedCue to falseend try
set searchText to my enterSomeText("Enter the text you wish to search for:", "", false)
set foundCues to cues whose q list name contains searchText
set countFoundCues to count foundCuesif countFoundCues = 0 thendisplay dialog "No cues were found." with title dialogTitle with icon 0 buttons {"OK"} default button "OK" giving up after 5returnend if
set foundNames to q list name of (cues whose q list name contains searchText)set foundNumbers to q number of (cues whose q list name contains searchText)
-- Make the popup list (###TODO### Not very efficient…)
set foundList to {}set cueListDetector to cue id "[root group of cue lists]"repeat with i from 1 to countFoundCuesset eachCue to item i of foundCuesset eachName to item i of foundNamesset eachNumber to item i of foundNumbersif eachNumber is "" thenset eachParent to parent of eachCueif eachParent is not cueListDetector and eachParent's parent is not cueListDetector then -- Found cues could contain cue lists…repeat until parent of eachParent's parent is cueListDetector -- Go up the hierarchy until you find a Group Cue directly in a cue listset eachParent to parent of eachParentend repeatset eachNumber to q number of eachParentif eachNumber is not "" thenset eachNumber to "{" & eachNumber & "}" -- "Inherited" cue number from enclosing group(s)end ifend ifend ifset eachParent to parent of eachCueif eachParent is cueListDetector thenset eachCueList to "N/A"elserepeat until eachParent's parent is cueListDetector -- Go up the hierarchy until you find a cue listset eachParent to parent of eachParentend repeatset eachCueList to q list name of eachParentend ifset end of foundList to (eachNumber & tab & eachName & tab & tab & "Cue List: " & eachCueList)end repeat
-- Display the list, including pre-selecting the cue after the selected cue
if selectedCue is false or ((uniqueID of selectedCue) is not in (uniqueID of cues whose q list name contains searchText)) thenset defaultChoice to 1elserepeat with i from 1 to countFoundCuesif selectedCue is item i of foundCues thenset defaultChoice to (i mod countFoundCues) + 1
exit repeatend ifend repeat
end if
set chosenCue to my pickFromListCustomDefault(foundList, "Please choose the cue to jump to:", defaultChoice)
-- Convert the answer to a cue
repeat with i from 1 to count foundListif chosenCue is item i of foundList thenset jumpToCue to item i of foundCues
exit repeatend ifend repeat
-- Move the selection
set selected to jumpToCue
end tell-- Subroutineson enterSomeText(thePrompt, defaultAnswer, emptyAllowed)tell application id "com.figure53.QLab.3"set theAnswer to ""repeat until theAnswer is not ""set theAnswer to text returned of (display dialog thePrompt with title dialogTitle default answer defaultAnswer buttons {"Cancel", "OK"} ¬default button "OK" cancel button "Cancel")if emptyAllowed is true then exit repeatend repeatreturn theAnswerend tellend enterSomeTexton pickFromListCustomDefault(theChoice, thePrompt, theDefault)tell application id "com.figure53.QLab.3"choose from list theChoice with prompt thePrompt with title dialogTitle default items item theDefault of theChoiceif result is not false thenreturn item 1 of resultelseerror number -128end ifend tellend pickFromListCustomDefault