• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Aug 18, 2014 Aug 18, 2014

Copy link to clipboard

Copied

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)                
                                        
}                                       
TOPICS
Scripting

Views

302

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 18, 2014 Aug 18, 2014

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

alert (app.FontWeightNames);

Rick

Votes

Translate

Translate
Community Expert ,
Aug 18, 2014 Aug 18, 2014

Copy link to clipboard

Copied

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

alert (app.FontWeightNames);

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 18, 2014 Aug 18, 2014

Copy link to clipboard

Copied

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)."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 18, 2014 Aug 18, 2014

Copy link to clipboard

Copied

"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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 18, 2014 Aug 18, 2014

Copy link to clipboard

Copied

LATEST

Many thanks,

Bob

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines