Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Need help cleaning up a script and adding loop

$
0
0

Awesome.

 

Any idea how to add this to the following script listener bit that changes the canvas size?

 

 

/ =======================================================

var idCnvS = charIDToTypeID( "CnvS" );

    var desc105 = new ActionDescriptor();

    var idWdth = charIDToTypeID( "Wdth" );

    var idPxl = charIDToTypeID( "#Pxl" );

    desc105.putUnitDouble( idWdth, idPxl, WIDTH GOES HERE? );

    var idHght = charIDToTypeID( "Hght" );

    var idPxl = charIDToTypeID( "#Pxl" );

    desc105.putUnitDouble( idHght, idPxl,  HEIGHT GOES HERE?);

    var idHrzn = charIDToTypeID( "Hrzn" );

    var idHrzL = charIDToTypeID( "HrzL" );

    var idCntr = charIDToTypeID( "Cntr" );

    desc105.putEnumerated( idHrzn, idHrzL, idCntr );

    var idVrtc = charIDToTypeID( "Vrtc" );

    var idVrtL = charIDToTypeID( "VrtL" );

    var idCntr = charIDToTypeID( "Cntr" );

    desc105.putEnumerated( idVrtc, idVrtL, idCntr );

executeAction( idCnvS, desc105, DialogModes.NO );

 

My initial thought was that I'd add the math bits above this, and then call the variables in the part where I put WIDTH GOES HERE, but that's not clear to me, since there's some if/then going on, and I'm not sure how to account for that.  Perhaps the script listener isn't the way to go for this?


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>