Advertisement
duquesne9

Create OSC from Eos Excel and insert into cue stack

Jun 20th, 2018
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (*Currently only moves cues if new placement is in group in Qlab 3, marks misplaced cues red. Fully functional in Qlab4 with edits*)
  2.  
  3.  
  4. set namePrefix to "LX"
  5. set lblCol to "F"
  6. set listnumCol to "C"
  7. set qnumCol to "D"
  8. set qNotesCol to "AE"
  9. set startRow to "3"
  10. set endRow to "700"
  11. set cueCount to ""
  12.  
  13. tell application id "com.figure53.QLab.3" to tell front workspace
  14.    
  15.     repeat with targetQ in (selected as list)
  16.        
  17.         set test to q number of targetQ
  18.         set rowNum to startRow
  19.        
  20.         tell application "Microsoft Excel"
  21.             repeat until (value of cell ("A" & rowNum) as string) is "END_TARGETS"
  22.                 if (value of cell (qNotesCol & rowNum) as string) is not "" then
  23.                     if (value of cell (qNotesCol & rowNum) as real) mod 1 is 0 then
  24.                         set qNotesStr to (value of cell (qNotesCol & rowNum) as integer) as string
  25.                     else
  26.                         set qNotesStr to (value of cell (qNotesCol & rowNum) as string)
  27.                     end if
  28.                    
  29.                     if qNotesStr is equal to test then
  30.                         --next series creates data for settings in newQ
  31.                         if (value of cell (qnumCol & rowNum) as real) mod 1 is 0 then
  32.                             set qNumStr to (value of cell (qnumCol & rowNum) as integer) as string
  33.                         else
  34.                             set qNumStr to (value of cell (qnumCol & rowNum) as string)
  35.                         end if
  36.                         if (value of cell (lblCol & rowNum) as string) is not "" then
  37.                             set lblTxt to " - " & (value of cell (lblCol & rowNum) as string) as string
  38.                         else
  39.                             set lblTxt to "" as string
  40.                         end if
  41.                         set qName to namePrefix & qNumStr & lblTxt
  42.                         set groupName to lblTxt
  43.                         set qCmd to ("/eos/cue/" & (value of cell (listnumCol & rowNum) as integer as string) & "/" & qNumStr & "/fire") as string
  44.                        
  45.                         tell application id "com.figure53.QLab.3" to tell front workspace
  46.                            
  47.                             set qlq to test & "LX"
  48.                             make type "osc"
  49.                             set newQ to last item of (selected as list)
  50.                             set properties of newQ to {q name:qName, osc message type:custom, custom message:qCmd, q number:qlq, continue mode:auto_continue}
  51.                            
  52.                             set newCueID to uniqueID of newQ
  53.                            
  54.                             if q type of targetQ is "group" then
  55.                                 move cue id newCueID of parent of newQ to beginning of targetQ
  56.                             else
  57.                                 set continue mode of cue before newQ to auto_continue
  58.                             end if
  59.                            
  60.                             if q type of parent of newQ is not "group" then
  61.                                 set continue mode of newQ to do_not_continue
  62.                             end if
  63.                            
  64.                             if q type of parent of newQ is "group" then
  65.                                 set cueCount to ((count cues) in parent of newQ)
  66.                             end if
  67.                             if cueCount is less than "2" then
  68.                                 set continue mode of newQ to do_not_continue
  69.                             end if
  70.                            
  71.                             if q number of cue before newQ is not test then
  72.                                 set myColor to "red"
  73.                                
  74.                                 set myOSC to "/cue/selected/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.                             end if
  78.                            
  79.                             set rowNum to rowNum + 1
  80.                            
  81.                         end tell
  82.                        
  83.                     else
  84.                         set rowNum to rowNum + 1
  85.                     end if
  86.                    
  87.                 else
  88.                     set rowNum to rowNum + 1
  89.                 end if
  90.                
  91.             end repeat
  92.            
  93.         end tell
  94.        
  95.     end repeat
  96.    
  97. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement