This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setbold(IO, start, end, fontSize) { | |
//Sanity checking: is the active layer a text layer? | |
var activeLayer = app.activeDocument.activeLayer; | |
if (activeLayer.kind == LayerKind.TEXT) { | |
//More checking: does the text layer have content, and are start and end set to reasonable values? | |
if ((activeLayer.textItem.contents != "") && (start >= 0) && (end <= activeLayer.textItem.contents.length)) { | |
//The indentation that the Script Listerner gives you is weird, but it’s useful. | |
var idsetd = app.charIDToTypeID("setd"); | |
var action = new ActionDescriptor(); | |
var idnull = app.charIDToTypeID("null"); |