Advertisement
duquesne9

make text cue from excel

Jul 10th, 2018
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Version 2.0
  2. --Written by Chase Elison 6/15/2018
  3. --Fully automatic script. Handles multiple Q lists.
  4. --Modified from Jack Baxter's code, THANK YOU JACK.
  5. --https://www.jackbaxtersound.co.uk/excel-import
  6.  
  7. display dialog "WARNING! DO NOT run this code unless you have the CSV file open in Excel that you exported from the console."
  8.  
  9. set namePrefix to the text returned of (display dialog "What prefix would you like for the cues? (e.g. Q1, Light Cue 1, LQ1...)" default answer "Q")
  10.  
  11. set textCol to "B"
  12. set startRow to "2"
  13. set endRow to "700" --this is really just a bailout number now, since this code is automatic
  14. set cellval to "Cell"
  15. set rowNum to startRow
  16. --repeat until rowNum = endRow + 1
  17. tell application "Microsoft Excel"
  18.     repeat until (value of cell ("A" & rowNum) as string) is "END_TARGETS"
  19.         if (value of cell (textCol & rowNum) as string) is not "" then
  20.             set textTxt to (value of cell (textCol & rowNum) as string) as string
  21.         else
  22.             set textTxt to "" as string
  23.         end if
  24.        
  25.         tell application id "com.figure53.QLab.3" to tell front workspace
  26.             make type "title"
  27.             set newQ to last item of (selected as list)
  28.             set text of newQ to textTxt
  29.             set the q number of newQ to ""
  30.         end tell
  31.        
  32.         set rowNum to rowNum + 1
  33.     end repeat
  34. end tell
  35.  
  36. display dialog (rowNum as string) & " was the final row!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement