Copy link to clipboard
Copied
I'm looking for a script that when i have texthighlighted, I can run it and it will increase the point size by just 1 point.
I know there is a way of changing this in the settings (units and increments) with no open documents so it applies it for all future documents created, however i often have to work on old files in which case it would revert back to the default of increasing it by 2. Seems to be document specific.
Any help with this would be greatly appreciated. Thanks!
Something like this should do the trick:
var tsr = app.selection[0].textStyleRanges.everyItem().getElements();
while (tsr.length) tsr.pop().pointSize += 1;
Ariel
P.S. There's no error testing here. So make sure to select some text before running the script.
Copy link to clipboard
Copied
Something like this should do the trick:
var tsr = app.selection[0].textStyleRanges.everyItem().getElements();
while (tsr.length) tsr.pop().pointSize += 1;
Ariel
P.S. There's no error testing here. So make sure to select some text before running the script.
Copy link to clipboard
Copied
Thanks TaW! Works perfectly 🙂
Copy link to clipboard
Copied
You can also script an existing document’s preference setting:
//sets the document’s Size/Leading unit
app.activeDocument.textPreferences.leadingKeyIncrement = "1pt"