Photoshop: Provide AppleScript access to the "Preserve Details 2.0" resampling method

  • 1
  • Idea
  • Updated 5 months ago
  • (Edited)
Please give us the ability to access the new "Preserve Details 2.0" resampling method via AppleScript. 

This method was introduced in CC 2018 and is popular with users - but cannot be automated without the access by script. (And yes, I do realize it's still a part of Technology Preview options).

Thanks,
Leo
Photo of Leo B

Leo B

  • 2 Posts
  • 0 Reply Likes

Posted 5 months ago

  • 1
Photo of Bret Linford

Bret Linford

  • 2 Posts
  • 0 Reply Likes
This would be great to be able to do this with automation and applescript, etc.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 14099 Posts
  • 1749 Reply Likes
You can call a JS from Apple Script to enable it if it's off:

// =======================================================
var idsetd = charIDToTypeID( "setd" );
    var desc45 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref9 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idexperimentalFeatures = stringIDToTypeID( "experimentalFeatures" );
        ref9.putProperty( idPrpr, idexperimentalFeatures );
        var idcapp = charIDToTypeID( "capp" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref9.putEnumerated( idcapp, idOrdn, idTrgt );
    desc45.putReference( idnull, ref9 );
    var idT = charIDToTypeID( "T   " );
        var desc46 = new ActionDescriptor();
        var idenhancedControlsTouchBarPropertyFeedback = stringIDToTypeID( "enhancedControlsTouchBarPropertyFeedback" );
        desc46.putBoolean( idenhancedControlsTouchBarPropertyFeedback, false );
        var idexpFeatureDeepUpscale = stringIDToTypeID( "expFeatureDeepUpscale" );
        desc46.putBoolean( idexpFeatureDeepUpscale, true );
    var idexperimentalFeatures = stringIDToTypeID( "experimentalFeatures" );
    desc45.putObject( idT, idexperimentalFeatures, desc46 );
executeAction( idsetd, desc45, DialogModes.NO );
Photo of Bret Linford

Bret Linford

  • 2 Posts
  • 0 Reply Likes
Thank, Jeffrey. Love your book!
Photo of Leo B

Leo B

  • 2 Posts
  • 0 Reply Likes
Hi Jeffrey,

Thank you for your reply!

Could you please clarify: as far as I understand, your script only activates the "Enable Preserve Details 2.0 Upscale" option in the preferences. Or am I wrong?

What I need is the ability to use the Preserve Details 2.0 resample method when using the resize image command in AppleScript. 

Right now the Photoshop AS dictionary doesn't list this method:
[resample method automatic/‌bicubic/‌bicubic automatic/‌bicubic sharper/‌bicubic smoother/‌bilinear/‌closest neighbor/‌none/‌preserve details] : what method should be used for resampling pixels ( default: bicubic )
Thanks again - your help is greatly appreciated.

Leo