Advertisement
duquesne9

Make memo for Eos Scene End

Jun 25th, 2018
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --defines
  2. set namePrefix to "LX"
  3. set lblCol to "F"
  4. set listnumCol to "C"
  5. set qnumCol to "D"
  6. set sceneEndCol to "AG"
  7. set sceneNotesCol to "AF"
  8. set qNotesCol to "AE"
  9. set startRow to "3"
  10. set endRow to "700"
  11. set cueCount to ""
  12.  
  13. --main
  14. tell application "QLab 3" to tell front workspace
  15.    
  16.     --repeat for all selected cues, how to iterate over entire cue list?
  17.     repeat with targetQ in (selected as list)
  18.        
  19.         set test to q number of targetQ
  20.         set rowNum to startRow
  21.        
  22.         tell application "Microsoft Excel"
  23.             --repeat runs theCue through Excel document until reaches end, how to make stop if it find match? can repeats have or statements?
  24.             repeat until (value of cell ("A" & rowNum) as string) is "END_TARGETS"
  25.                 --Checks for a note
  26.                 if (value of cell (sceneEndCol & rowNum) as string) is "Scene_End" then
  27.                     --makes note value usable
  28.                     if (value of cell (qNotesCol & rowNum) as real) mod 1 is 0 then
  29.                         set qNotesStr to (value of cell (qNotesCol & rowNum) as integer) as string
  30.                     else
  31.                         set qNotesStr to (value of cell (qNotesCol & rowNum) as string)
  32.                     end if
  33.                    
  34.                     if qNotesStr is equal to test then
  35.                        
  36.                         --next series creates data for settings in newQ
  37.                         if (value of cell (qnumCol & rowNum) as real) mod 1 is 0 then
  38.                             set qNumStr to (value of cell (qnumCol & rowNum) as integer) as string
  39.                         else
  40.                             set qNumStr to (value of cell (qnumCol & rowNum) as string)
  41.                         end if
  42.                         if (value of cell (sceneNotesCol & rowNum) as string) is not "" then
  43.                             set lblTxt to (value of cell (sceneNotesCol & rowNum) as string) as string
  44.                         else
  45.                             set lblTxt to "" as string
  46.                         end if
  47.                         set qName to lblTxt & " END"
  48.                        
  49.                        
  50.                         --creates newQ, then moves it into targetQ, deletes newQ if targetQ is not group
  51.                         tell application id "com.figure53.QLab.3" to tell front workspace
  52.                            
  53.                            
  54.                             set qNum to (q number of targetQ) & ".END"
  55.                             make type "Memo"
  56.                             set newQ to last item of (selected as list)
  57.                             set properties of newQ to {q name:qName, q number:qNum, continue mode:do_not_continue}
  58.                            
  59.                             set newCueID to uniqueID of newQ
  60.                             --move cue id newCueID to after cue targetQ
  61.                            
  62.                             --set targetQNum to "\"" & (q number of targetQ) & "\""
  63.                             tell parent of newQ
  64.                                 --move cue id newCueID to after cue "\"TargetQ\""
  65.                                 --move cue id newCueID to after cue ("\"" & (q number of targetQ) & "\"")
  66.                                 move cue id newCueID to after cue (q number of targetQ)
  67.                                
  68.                             end tell
  69.                             set continue mode of parent of newQ to auto_continue
  70.                            
  71.                             set myCue to q number of newQ
  72.                             set myColor to "yellow"
  73.                            
  74.                             set myOSC to "/cue/" & myCue & "/colorName " & myColor
  75.                             do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
  76.                             --set q color of newQ to "red"
  77.                            
  78.                             set rowNum to rowNum + 1
  79.                            
  80.                             exit repeat
  81.                            
  82.                         end tell
  83.                        
  84.                        
  85.                     else
  86.                         set rowNum to rowNum + 1
  87.                     end if
  88.                    
  89.                    
  90.                 else
  91.                     set rowNum to rowNum + 1
  92.                 end if
  93.                
  94.             end repeat
  95.            
  96.         end tell
  97.        
  98.     end repeat
  99.    
  100. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement