Copy link to clipboard
Copied
How to get the Text's StrokeWeight value in the TextFrame (not refering to the Frame stroke weight)
Please help... Thank you very much.
Be sure to select text with equal formatting.
//ID CS 5.5
var strokeMeasurementUnit = app.viewPreferences.strokeMeasurementUnits.toString();
var mySel = app.selection[0];
alert('Strokecolourname: ' + mySel.strokeColor.name + ' \n ' + 'Strokeweight: ' + mySel.strokeWeight + ' ' + strokeMeasurementUnit)
Copy link to clipboard
Copied
Hi,
those are quite normal properties in the text suite:
//select some text
with(app.selection[0]){
strokeAlignment = TextStrokeAlign.CENTER_ALIGNMENT;//TextStrokeAlign.OUTSIDE_ALIGNMENT
strokeColor = 'C=75 M=5 Y=100 K=0';
strokeWeight = '1 pt'
}
Hope it'll work
Hans-Gerd Claßen
Copy link to clipboard
Copied
Thanks for the reply.
i don't mean to set the text strokeWeight style in the document, but am trying to use a script to find out the text's stroke properties on page.
Copy link to clipboard
Copied
to be more specific, i'm trying to use JS to find out a particular (selected) text's stroke weight and it's color.
Thanks
Copy link to clipboard
Copied
Be sure to select text with equal formatting.
//ID CS 5.5
var strokeMeasurementUnit = app.viewPreferences.strokeMeasurementUnits.toString();
var mySel = app.selection[0];
alert('Strokecolourname: ' + mySel.strokeColor.name + ' \n ' + 'Strokeweight: ' + mySel.strokeWeight + ' ' + strokeMeasurementUnit)
Copy link to clipboard
Copied
Thanks so much ![]()
Copy link to clipboard
Copied
app.selection[0].strokeWeight //Stroke weight of the text
app.selection[0].strokeColor.colorValue //Stroke Color of the text
Code is based on the premise that the selection is on a text.
Manan Joshi
Copy link to clipboard
Copied
Manan, please trim your signature in the future. Thanks.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now