1 person found this helpful
Create a textframe with min 1 character and run the following script.
Perhaps it's a little bit helpful.
// characterAttributes var aDoc = app.activeDocument; var aChar = aDoc.textFrames.characters; alert (aChar.characterAttributes.size) alert (aChar.characterAttributes.alignment) alert(aDoc.characterStyles.length) alert(aDoc.characterStyles.characterAttributes.size)
In ESTK OMV you can see much more character attributes.
2 people found this helpful
this covers the first question, select a text frame before running
var idoc = app.activeDocument; var sel = idoc.selection; alert(sel.textRange.characterStyles.name); // returns the first character style
The problem is I want to extract all text in a doc and get information like font, bold or so for every single text. For example:
bold: this is the text.
Instead of checking character attribute of each character, I'm think about iterate every characterstyle. So I need to know the parent of each characterstyle, right?
Do you really mean characterstyle or paragraphstyle?
For character style, you have to loop through all the characters. And every char "without" characterstyle yet still have one --> aDoc.characterStyles
How does characterStyle tell from each other? I found the name of these characterStyles all the same.
Are there any place in a doc used to save these characterStyles or characterAttributes? Also, I found the parent of these characterStyles the same. Then how can I know who does these characterStyle belong to?