Underlining Part of Text Via Script
-
mycort
Underlining Part of Text Via Script
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?
-
Mike Hale
Underlining Part of Text Via Script
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]
];
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
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
... 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.
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
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]
];
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]
];