Underlining Part of Text Via Script

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

mycort

Underlining Part of Text Via Script

Post by mycort »

Just got a question, I'm seeing code for One, Two, Three......does this specifically have to do with text string lines 1,2,3? What if the lines go beyond 3rd line, go to more like lines 4,5,6....etc? Hopefully I'm just not understanding this and is actually more scalable?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Underlining Part of Text Via Script

Post by Mike Hale »

No, this code is for pointtext. All the text will be on one line. The array is for text ranges. To add more ranges you just add to the array. Something like this:
Code: Select allvar theArray = [
   ["One, ", 12, "Arial", false, false],
   ["two, ", 15, "Arial", true, false],
   ["three, ", 12, "Arial", false, true],
   ["four, ", 12, "Arial", false, false],
   ["five.", 12, "Arial", true, true]
];
mycort

Underlining Part of Text Via Script

Post by mycort »

Didnt realize after trying to copy this array of an array, that it's actually a very long and complicated code for something as simple as underlining a portion of a text......interesting how code works......
Mike Hale

Underlining Part of Text Via Script

Post by Mike Hale »

... it's actually a very long and complicated code for something as simple as underlining a portion of a text

It could be much longer. It doesn't set every text range option. The options not set by the code will use the default for that option.

Changing a text range may be simple in the Photoshop GUI but it's not when scripted. This or something similar( and perhaps longer - see some Xbytor's text range scripts ) is the only way you can script text ranges. The Photoshop Object Model only works with one range.
mycort

Underlining Part of Text Via Script

Post by mycort »

why is there a difference in numbers of 12,15,12,12,12 :

var theArray = [
["One, ", 12, "Arial", false, false],
["two, ", 15, "Arial", true, false],
["three, ", 12, "Arial", false, true],
["four, ", 12, "Arial", false, false],
["five.", 12, "Arial", true, true]
];
Mike Hale

Underlining Part of Text Via Script

Post by Mike Hale »

It's the size of the text in points.