How to change the pixels to mm units

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

mead
Posts: 20
Joined: Sat Jul 23, 2022 12:28 am

How to change the pixels to mm units

Post by mead »

Code: Select all

  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(cTID('Wdth'), cTID('#Pxl'), 413);	//change 413 mm
    desc1.putUnitDouble(cTID('Rslt'), cTID('#Rsl'), 320);	//change 320 mm
    desc1.putBoolean(sTID("scaleStyles"), true);
    desc1.putBoolean(cTID('CnsP'), true);
    desc1.putEnumerated(cTID('Intr'), cTID('Intp'), sTID("automaticInterpolation"));
    executeAction(sTID('imageSize'), desc1, dialogMode);
  };
  
 
// How to change the pixels to mm units
413px-413mm
320px-320mm
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: How to change the pixels to mm units

Post by Kukurykus »

You were already answered how to recalculate units in Canvas size thread.