Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- This script intednded to add cue colors to all selected cues based on the type of cue.
- v2 UPDATE: I realize it's only been a few hours, but I have a partial fix for the issue of applying color to all selected cues. Added variable for selected cue to myOSC string that limits to chosen cue as long as chosen cue is numbered. If it is not numbered, it will apply color to all unnumbered cues.*)
- tell application id "com.figure53.QLab.3" to tell front workspace
- set selectedCues to (selected as list)
- repeat with targetQ in selectedCues
- --set newQ to current in selectedCues
- (*
- if q type of targetQ is "group" then
- set myColor to "green"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "osc" or "midi" or "midi file" or "timecode" then
- set myColor to "blue"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "audio" or "video" or "mic" or "camera" or "text" or "fade" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "stop" or "start" or "goto" or "devamp" or "load" or "pause" or "reset" or "target" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "arm" or "disarm" or "wait" then
- set myColor to "orange"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "memo" then
- set myColor to "yellow"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- end if
- *)
- set colorQ to q number of targetQ
- if q type of targetQ is "group" then
- set myColor to "green"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "osc" then
- set myColor to "blue"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "midi" then
- set myColor to "blue"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "midi file" then
- set myColor to "blue"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "timecode" then
- set myColor to "blue"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "audio" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "video" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "camera" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "text" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "mic" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "fade" then
- set myColor to "purple"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "target" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "stop" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "start" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "goto" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "devamp" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "load" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "pause" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "reset" then
- set myColor to "gray"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "arm" then
- set myColor to "orange"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "disarm" then
- set myColor to "orange"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "wait" then
- set myColor to "orange"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- else if q type of targetQ is "memo" then
- set myColor to "yellow"
- set myOSC to "/cue/{" & colorQ & "}/colorName " & myColor
- do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"
- end if
- end repeat
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement