Skip to main content
Inspiring
August 18, 2014
Answered

How do I obtain a list of a document's "FontWeightNames"

FM 12 - Javascript

I cannot find the correct way to obtain a list of a document's "FontWeightNames"

This is as I understand it (but it does not work):

var mydocweights = MyDoc.FontWeightNames
                                        

for (var i=0; i < mydocweights.length; i++) {

                                        
  alert(mydocweights)                
                                        
}                                       
This topic is closed to new replies. Start a new post to keep the conversation going.
frameexpert
frameexpertCorrect answer
Community Expert
August 18, 2014

FontWeightNames are not a property of a document, but of the top-level app object. Try this:

alert (app.FontWeightNames);

Rick

www.frameexpert.com

4 replies

Inspiring
August 18, 2014

Hi Rick,

Many thanks!

I may have been confused by the documentation  - I thought a "Session" was the open Book or Document:

"Denotes the font weight (specifies an index into the array of font weights provided by the session property

FontWeightNames)."

Translate
frameexpert
Community Expert
Community Expert
August 18, 2014

"Session" is actually the top-level-object in the FDK (Frame Developers Kit) and FrameScript. In ExtendScript, the "app" object is the equivalent. They probably used app because it is more in line with other Adobe scripting environments. The documentation was probably derived from the FDK docs and maybe that is how Session got in there.

Translate
www.frameexpert.com
Inspiring
August 18, 2014

Many thanks,

Bob

Translate
frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
August 18, 2014

FontWeightNames are not a property of a document, but of the top-level app object. Try this:

alert (app.FontWeightNames);

Rick

Translate
www.frameexpert.com