Copy link to clipboard
Copied
I need to create hundreds of curves adjustment presets. I have a spreadsheet containing the what the preset needs to be saved as (named) in one column and what the RGB output values need to be in another 3 separate columns. The input value for all is 65. Rather than building them all by hand I was hoping to find a script to build them base off the values in the spreadsheet. Anyone have any suggestions?
Copy link to clipboard
Copied
if (create_acv("~/Desktop", "test_preset", 100, 101, 102))
alert("Done!");
function create_acv(path, name, r, g, b)
{
try {
var data = String.fromCharCode(0,4, 0,5,
0,2, 0,0,0,0, 0,255,0,255,
0,3, 0,0,0,0, (r>>8)&255,r&255, 0,65, 0,255,0,255,
0,3, 0,0,0,0, (g>>8)&255,g&255, 0,65, 0,255,0,255,
0,3, 0,0,0,0, (b>>8)&255,b&255, 0,65, 0,255,0,255,
0,2, 0,0,0,0, 0,255,0,255);
var file = new File(path + "/" + name + ".acv");
file.open("w");
file.encoding = "BINARY";
file.write(data);
if (file.error) throw(file.error);
file.close();
return true;
}
catch(e) { alert(e); return false; }
}