API Support for Perspective Auto Correction in VBScript

New Here ,
Mar 16, 2021 Mar 16, 2021

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

TOPICS
How to, Windows

Views

39

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 16, 2021 Mar 16, 2021

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 );
}

 

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

I'm talking about atomatical perspective corection represented in this buttonNew Picture (26).jpg

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines