Advertisement
duquesne9

Create Looping Slideshow QLab

Mar 6th, 2019
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (*
  2. Tested with QLab v3.2.14 Oct 2018
  3. Please report any issues to robotlightsyou@gmail.com with subject "QLAB 3 template issues"
  4. *)
  5.  
  6. -- Create slideshow from selected cues
  7. -- Tim Rogers <timmrogers@gmail.com>
  8.  
  9.  
  10. set finalPostWait to "0"
  11.  
  12. tell application id "com.figure53.qlab.3" to tell front workspace
  13.    
  14.     display dialog "Enter the number of seconds between cues:" default answer "10"
  15.    
  16.     --next block to insure user enters valid numeral
  17.     try
  18.         set myPostWait to (text returned of result) as number
  19.     on error
  20.         display alert "Invalid number" message "Please enter a valid number."
  21.         return
  22.     end try
  23.    
  24.     set mySelected to (selected as list)
  25.     set myCount to (count mySelected)
  26.     set loopStartTarget to first item of mySelected
  27.     repeat with myCurrentCue in mySelected
  28.        
  29.         -- Get the uniqueID of the current cue
  30.         set myID to uniqueID of myCurrentCue
  31.        
  32.         -- Move the selection to the current cue        
  33.         tell the current cue list
  34.             set playback position to cue id myID
  35.         end tell
  36.        
  37.         -- Set opacity and continue mode of the current cue
  38.         set opacity of myCurrentCue to 0
  39.         set continue mode of myCurrentCue to auto_continue
  40.        
  41.         if myCurrentCue's contents is the first item of mySelected then
  42.            
  43.            
  44.             -- Make new fade cue
  45.             make type "Fade"
  46.             -- and find its name
  47.             set myNewCueList to selected
  48.             set myNewCue to last item of myNewCueList
  49.             -- and set its target, opacity, and post wait
  50.             set cue target of myNewCue to myCurrentCue
  51.             set opacity of myNewCue to 100
  52.             set do opacity of myNewCue to true
  53.             set post wait of myNewCue to myPostWait
  54.             set continue mode of myNewCue to auto_continue
  55.             -- Set previous cue
  56.             set myPreviousCue to myCurrentCue
  57.             set myCount to myCount - 1
  58.            
  59.             -- Otherwise
  60.            
  61.         else if myCount is 1 then
  62.             -- Make new fade cue
  63.             make type "Fade"
  64.             -- and find its name
  65.             set myNewCueList to selected
  66.             set myNewCue to last item of myNewCueList
  67.             -- and set its target and opacity
  68.             set cue target of myNewCue to myCurrentCue
  69.             set opacity of myNewCue to 100
  70.             set do opacity of myNewCue to true
  71.             set continue mode of myNewCue to auto_continue
  72.            
  73.            
  74.             -- Make new fade-and-stop cue
  75.            
  76.             make type "Fade"
  77.             -- and find its name
  78.             set myNewCueList to selected
  79.             set myNewCue to last item of myNewCueList
  80.             -- and set its target, opacity, post wait, and stop
  81.             set cue target of myNewCue to myPreviousCue
  82.             set opacity of myNewCue to 0
  83.             set do opacity of myNewCue to true
  84.             set post wait of myNewCue to myPostWait
  85.             set stop target when done of myNewCue to true
  86.             set continue mode of myNewCue to auto_continue
  87.             -- Set previous cue
  88.             set myPreviousCue to myCurrentCue
  89.             set myCount to myCount - 1
  90.            
  91.             --make last fade and stop
  92.             make type "Fade"
  93.             -- and find its name
  94.             set myNewCueList to selected
  95.             set myNewCue to last item of myNewCueList
  96.             -- and set its target, opacity, post wait, and stop
  97.             set cue target of myNewCue to myPreviousCue
  98.             set opacity of myNewCue to 0
  99.             set do opacity of myNewCue to true
  100.             set post wait of myNewCue to finalPostWait
  101.             set stop target when done of myNewCue to true
  102.             set continue mode of myNewCue to auto_continue
  103.             -- Set previous cue
  104.             set myPreviousCue to myCurrentCue
  105.             set myCount to myCount - 1
  106.            
  107.            
  108.         else
  109.             -- Make new fade cue
  110.             make type "Fade"
  111.             -- and find its name
  112.             set myNewCueList to selected
  113.             set myNewCue to last item of myNewCueList
  114.             -- and set its target and opacity
  115.             set cue target of myNewCue to myCurrentCue
  116.             set opacity of myNewCue to 100
  117.             set do opacity of myNewCue to true
  118.             set continue mode of myNewCue to auto_continue
  119.             -- Make new fade-and-stop cue
  120.            
  121.             make type "Fade"
  122.             -- and find its name
  123.             set myNewCueList to selected
  124.             set myNewCue to last item of myNewCueList
  125.             -- and set its target, opacity, post wait, and stop
  126.             set cue target of myNewCue to myPreviousCue
  127.             set opacity of myNewCue to 0
  128.             set do opacity of myNewCue to true
  129.             set post wait of myNewCue to myPostWait
  130.             set stop target when done of myNewCue to true
  131.             set continue mode of myNewCue to auto_continue
  132.             -- Set previous cue
  133.             set myPreviousCue to myCurrentCue
  134.             set myCount to myCount - 1
  135.            
  136.            
  137.         end if
  138.        
  139.        
  140.     end repeat
  141.    
  142.     make type "Start"
  143.     set loopStart to last item of (selected as list)
  144.     set cue target of loopStart to loopStartTarget
  145.    
  146. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement