After fiddling with similar things on my own on past projects, I've decided to finally start putting together a mega-Google Sheet template of all sorts of different batch cue generating needs. I'd love people's input, but to keep it from turning into a messy pot, I'm not sharing editing privileges with everyone just yet.
The idea is that a sheet and script go hand-in-hand. Just make a copy of the sheet and duplicate as many tabs as you want. Just don't delete things in the gray boxes; some are using formulas.
Google Sheets exports CSVs just one page/tab at a time, making it easy to keep them all in one place.
In particular, I finished one for importing ProTools Markers and generating start cues, and one that turns ProTools Markers into slices in a cue.
Even though the discussion here is on Adobe Editors, I still figured I would share here because of the way I use a CSV file without opening a spreadsheet app like Excel.
The scripts prompt for a csv file, and then just run without Microsoft Excel. I thought I stole this way of parsing CSVs from Mic, but now I'm not sure. It looks like a relatively simple bit of code, so he must be aware of some potential drawbacks. But this has consistently worked for me. *shrug*
Export the markers to a text file like normal, then Select All, Copy, and Paste in cell A1 of the Google Spreadsheet
Just copy and paste the whole thing. That way it includes the project name, and the sample rate. The sheet uses the sample rate to calculate the time with a greater precision. And the Start Cue script also uses the session name to create a new cue lists to populate the new cues.
I'd love any feedback people have!
Send me any common CSVs, and ideas of what to do with them!
Tested with ProTools Version 2020.9.1
To Import Start Cues from CSV
--by Taylor Glad. Updated 6/7/21
--Script will prompt you for a csv file. You don't need Microsoft Excel.
--select csv file from ProTools Marker Start Cues tab of the QLab batch cues template sheet
-- Columns are #,Time, Time Reference, Units, Name, Comments, Seconds
set TheFile to choose file of type "csv" with prompt "Select a csv file:"
set theFileContents to read TheFile
set thetids to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set thenumberofrows to count of paragraphs of theFileContents
tell application id "com.figure53.QLab.4" to tell front workspace
make type "cue list"
set songName to (text item 2 of paragraph 1 of theFileContents) & " Marker Import"
--If you want the new cues to be put inside a new group, instead of a new Cue List, comment out the following two lines of code, and uncomment out the rest.
set q name of last cue list to songName
set current cue list to first cue list whose q name is songName
--make type "group"
--set theGroup to last item of (selected as list)
--set the mode of theGroup to timeline
--set the q name of theGroup to songName
repeat with makeCues from 13 to thenumberofcues --starts in 13 to skip the other pasted jargon
set theRow to (paragraph makeCues) of theFileContents
make type "start"
set theCue to last item of (selected as list)
set the q number of theCue to text item 1 of theRow
set the pre wait of theCue to text item 7 of theRow
set the q name of theCue to text item 5 of theRow
set the notes of theCue to text item 6 of theRow
--move cue id (uniqueID of theCue) of parent of theCue to end of theGroup
end repeat
end tell
set AppleScript's text item delimiters to thetids
Import Slices from CSV (into selected audio/video cue)
--by Taylor Glad. Updated 6/7/21
--Script will prompt you for a csv file. You don't need Microsoft Excel.
--select csv file from ProTools Marker Start Cues tab of the QLab batch cues template sheet
-- Columns are #,Time, Time Reference, Units, Name, Comments, Seconds, Play Count
--The script makes sure you have at least one audio or video cue selected. It lets you select multiple to let you do you.
--The script will also tell you if the end time of a cue you have selected is shorter than one of your markers.
tell application id "com.figure53.QLab.4" to tell front workspace
set theSelection to the selected as list
repeat with theCue in theSelection
if (the q type of theCue is "Video") or (the q type of theCue is "Audio") then
set TheFile to choose file of type "csv" with prompt "Select a csv file:"
set theFileContents to read TheFile
set thetids to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set thenumberofrows to count of paragraphs of theFileContents
set theCueEndTime to the end time of theCue
set theMarkers to {}
repeat with rowCount from 13 to thenumberofrows --starts in 13 to skip the other pasted jargon
set eachRow to (paragraph rowCount) of theFileContents
set theSliceTime to (text item 7 of eachRow)
if theSliceTime as real is greater than theCueEndTime as real then
display dialog "One of the imported slices in your CSV is past the end time of your selected cue" with title "Incompatible Marker" with icon 2
return
end if
set theSlicePlayCount to (text item 8 of eachRow)
if theSlicePlayCount is not "inf" then
if (text item 8 of eachRow as string as real) * 1 is 0 then
set theSlicePlayCount to "1"
end if
end if
set end of theMarkers to {time:theSliceTime, playCount:theSlicePlayCount}
end repeat --for eachLine
set the slice markers of theCue to theMarkers
else --theCue is an Audio or Video cue
display dialog "Please select an audio or video cue before running this script." with title "Select Audio or Video Cue" with icon 2
end if --theCue is an Audio or Video cue
end repeat --of the selected cues
end tell