Skip to main content
This topic has been closed for replies.

1 reply

rob day
Community Expert
Community Expert
March 16, 2021

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

 

 

SergheiTAuthor
Participant
March 16, 2021

I'm talking about atomatical perspective corection represented in this button