This content has been marked as final. Show 4 replies
The reason you get the auto enumeration is because that's what the leading is set to. It's up to you to do the calculation. But your assumption that you can use the line's leading value is false. You must use the specific character you're interested in.
While internally, InDesign uses the maximum leading in use on the line for the line, when you get the line's leading from the Object Model, you actually get the leading of the first character of the line only. This might be why you are confused about sometimes getting the explicit value -- each character can have a different leading.
I think this confusion about what the line.leading really returns is what is causing most of your confusion.
Bear in mind that if you have an inline graphic in the line, the leading of the character holding the graphic is a more complicated calculation yet.
For example:(PointSize=10 and AutoLeading=120% of the Paragraphs)
"Chinese president urges APEC members to boost economic integration, strengthen human security
LIMA, Nov. 23 (Xinhua) -- Chinese President Hu Jintao on Sunday urged the Asia-Pacific Economic Cooperation (APEC) members to boost economic integration and strengthen human security in the region."
When the Leading of "APEC" was set manually to 30 points in the Leading menu of the Character panel. The line's Leading that "APEC" is in will be increased to 30.
Using the following VBAScript, We just can get MaxLeading =1635019116(idLeading.idAuto) and LinePointsize =10 and MaxLeading =120%. If we calculate the Leading by autleading*poinsize, the Leading will be 12, but the actual Leading is 30 points.
myLineCharacterTotal = myLine.Characters.Count
MaxLeading = 0
For myCharacterCounter = 1 To myLineCharacterTotal
Set myCharacter = myLine.Characters.Item(myCharacterCounter)
myCharacterPointSize = myCharacter.PointSize
myCharacterLeading = myCharacter.Leading
myCharacterAutoLeading = myCharacter.AutoLeading
If MaxLeading < myCharacterLeading Then
MaxLeading = myCharacterLeading
If MaxAutoLeading < myCharacterAutoLeading Then
MaxAutoLeading = myCharacterAutoLeading
If myLinePointSize < myCharacterPointSize Then
myLinePointSize = myCharacterPointSize