Hello everyone, I’m new to the forum so hopefully I’m not breaking any rules here.
I just want to share some progress I have made to automate conforming process in DaVinci resolve.
set {redColor, blueColor, greenColor} to {missing value, missing value, missing value}
set {redColor1, blueColor1, greenColor1} to {missing value, missing value, missing value}
set {redColor2, blueColor2, greenColor2} to {missing value, missing value, missing value}
set {redColor3, blueColor3, greenColor3} to {missing value, missing value, missing value}
set {redColor4, blueColor4, greenColor4} to {missing value, missing value, missing value}
repeat 60 times
do shell script "/usr/local/bin/cliclick m:" & "1885,450"
tell application "Digital Color Meter" to activate
tell application "System Events"
tell process "Digital Color Meter"
click menu item "Copy Color as Text" of menu 1 of menu bar item "Color" of menu bar 1
end tell
end tell
set rgbColors to words of (the clipboard)
if (count of rgbColors) is 3 then
set {redColor, blueColor, greenColor} to {item 1 of rgbColors, item 2 of rgbColors, item 3 of rgbColors}
end if
do shell script "/usr/local/bin/cliclick m:" & "2480,550"
tell application "Digital Color Meter" to activate
tell application "System Events"
tell process "Digital Color Meter"
click menu item "Copy Color as Text" of menu 1 of menu bar item "Color" of menu bar 1
end tell
end tell
set rgbColors to words of (the clipboard)
if (count of rgbColors) is 3 then
set {redColor1, blueColor1, greenColor1} to {item 1 of rgbColors, item 2 of rgbColors, item 3 of rgbColors}
end if
do shell script "/usr/local/bin/cliclick m:" & "2480,170"
tell application "Digital Color Meter" to activate
tell application "System Events"
tell process "Digital Color Meter"
click menu item "Copy Color as Text" of menu 1 of menu bar item "Color" of menu bar 1
end tell
end tell
set rgbColors to words of (the clipboard)
if (count of rgbColors) is 3 then
set {redColor2, blueColor2, greenColor2} to {item 1 of rgbColors, item 2 of rgbColors, item 3 of rgbColors}
end if
do shell script "/usr/local/bin/cliclick m:" & "1750,180"
tell application "Digital Color Meter" to activate
tell application "System Events"
tell process "Digital Color Meter"
click menu item "Copy Color as Text" of menu 1 of menu bar item "Color" of menu bar 1
end tell
end tell
set rgbColors to words of (the clipboard)
if (count of rgbColors) is 3 then
set {redColor3, blueColor3, greenColor3} to {item 1 of rgbColors, item 2 of rgbColors, item 3 of rgbColors}
end if
do shell script "/usr/local/bin/cliclick m:" & "2110,570"
tell application "Digital Color Meter" to activate
tell application "System Events"
tell process "Digital Color Meter"
click menu item "Copy Color as Text" of menu 1 of menu bar item "Color" of menu bar 1
end tell
end tell
set rgbColors to words of (the clipboard)
if (count of rgbColors) is 3 then
set {redColor4, blueColor4, greenColor4} to {item 1 of rgbColors, item 2 of rgbColors, item 3 of rgbColors}
end if
set redColor to redColor as number
set blueColor to blueColor as number
set greenColor to greenColor as number
set redColor1 to redColor1 as number
set blueColor1 to blueColor1 as number
set greenColor1 to greenColor1 as number
set redColor2 to redColor2 as number
set blueColor2 to blueColor2 as number
set greenColor2 to greenColor2 as number
set redColor3 to redColor3 as number
set blueColor3 to blueColor3 as number
set greenColor3 to greenColor3 as number
set redColor4 to redColor4 as number
set blueColor4 to blueColor4 as number
set greenColor4 to greenColor4 as number
if redColor < 10 and blueColor < 10 and greenColor < 10 and redColor1 < 10 and blueColor1 < 10 and greenColor1 < 10 and redColor2 < 10 and blueColor2 < 10 and greenColor2 < 10 and redColor3 < 10 and blueColor3 < 10 and greenColor3 < 10 and redColor4 < 10 and blueColor4 < 10 and greenColor4 < 10 then
activate application "DaVinci Resolve"
tell application "System Events"
delay 0.2
key code 125
end tell
else
activate application "DaVinci Resolve"
tell application "System Events"
delay 0.2
key code 43
end tell
end if
end repeat
So basically I’m trying to use default mac color picker to identity my preview screen and trying to match my source clip with reference clip at the correct frame. I move my source clip one frame at the time and once my screen is black, (I have ‘difference’ filter turned on) that means the clips are matched.
The problem I have however, is that color picker only picks up a small percentage of the frame, so currently I have to create 5 points, but it’s still not enough. I’m wondering if there is a better way to achieve this, preferably in applescript.
PS: I know my code probably looks horrendous, but it’s the best I can do right now