Skip to main content
Inspiring
April 12, 2023
Question

Change trap units using javascript

  • April 12, 2023
  • 2 replies
  • 472 views

Is it possible to change trap units from pixels to millimeters using javascript. By default, trap units are set on pixels, i need to change it to millimeters using javacsript. I use this script to complete traping, and it works correct only if units are manualy changed to millimeters. How to imporve this?

    var idTrap = charIDToTypeID( "Trap" );
    var desc6698 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idRlt = charIDToTypeID( "#Rlt" );
    desc6698.putUnitDouble( idWdth, idRlt, 0.566895 );
    executeAction( idTrap, desc6698, DialogModes.NO );

 

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
April 12, 2023
milevicAuthor
Inspiring
April 12, 2023

Obviously we didn't chew it all 🙂 It was two years ago, i hope there are some updates 🙂

milevicAuthor
Inspiring
April 12, 2023

Or just to alert user that units are not in millimeters...