Copy link to clipboard
Copied
Is it possible to automate Perspective Auto Correction in PS 20.0.6 using VBScript? This feature is not covered in docs in Camera RAW Section https://www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-vbs-ref-2020.pdf
Thanks in advance
Copy link to clipboard
Copied
I’m not sure about VB, but you can set the RAW settings with Javascript on an open via ActionDescriptor() objects, which can be recorded. This would open a RAW file as a smart object with the transform variables applied:
#target photoshop
//The Camera RAW Manual Transformations
var vert = 20
var horz = 30
var rot = 3
var ar = 0
var scl = 110
var offx = -5
var offy = 5
var f = File.openDialog("Open File");
if(f != null){
openTransformed(File(f));
}
/**
* Use ActionDescriptors to open RAW as a smart object
* the file path
* void
*
*/
function openTransformed(p){
var d1 = new ActionDescriptor();
d1.putPath( stringIDToTypeID( "null" ), new File( p ) );
var d2 = new ActionDescriptor();
//Manual Transforms
d2.putInteger( charIDToTypeID( "PerV" ), vert );
d2.putInteger( charIDToTypeID( "PerH" ), horz );
d2.putDouble( charIDToTypeID( "PerR" ), rot );
d2.putInteger( charIDToTypeID( "PerA" ), ar );
d2.putInteger( charIDToTypeID( "PerS" ), scl );
d2.putDouble( charIDToTypeID( "PerX" ), offx );
d2.putDouble( charIDToTypeID( "PerY" ), offy );
d1.putObject( stringIDToTypeID( "as" ), stringIDToTypeID( "Adobe Camera Raw" ), d2 );
d1.putBoolean( stringIDToTypeID( "smartObject" ), true );
executeAction( stringIDToTypeID( "open" ), d1, DialogModes.NO );
}
Copy link to clipboard
Copied
I'm talking about atomatical perspective corection represented in this button