08.08.14, 15:24
I got this error but everything works fine:
TypeError: Cannot read property "characterStyle" from undefined
at My Scripts/doeke/baselineShift1.js:17
is this a scriptographer bug?
here's the script:
// var selectedTextItem = document.getItems({ type: TextItem, selected: true }); if (selectedTextItem.length > 0) { var item = selectedTextItem[0]; //item.remove(); var xChars = item.range.characters.length; print("xCharacters "+xChars); var yShift = 0; var step = 0.03 var dir = 1; for (var i = 0; i <= xChars; i++){ item.range.characters[i].characterStyle.baselineShift = yShift; yShift +=step*dir; if (yShift >= 1 || yShift <= 0){ dir = -dir;; } } } else { Dialog.alert('Please select a textItem first!'); } //