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

Changing text item content automaticallz changes text size.

$
0
0

For example : I have text with size 53,14 pt, script change content, and text size is 30 pt. Does anyone have any idea why is this happening ? Even when I try alert(layer.size); it will show 30pt.

 

//function generated from action

cTID = function(s) { return app.charIDToTypeID(s); };

sTID = function(s) { return app.stringIDToTypeID(s); };

 

 

selectLayer("odbor");

var odborLayer = doc.activeLayer.textItem;

odborLayer.contents = odbor;

 

 

function selectLayer(name) {

  // Select

  function step1(enabled, withDialog) {

    if (enabled != undefined && !enabled)

      return;

    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putName(cTID('Lyr '), name);

    desc1.putReference(cTID('null'), ref1);

    desc1.putBoolean(cTID('MkVs'), false);

    executeAction(cTID('slct'), desc1, dialogMode);

  };

  step1();      // Select

};


Viewing all articles
Browse latest Browse all 27456

Trending Articles



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