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

FrameMaker ExtendScript: Finding a list of user-defined objects

Community Expert ,
Apr 10, 2020 Apr 10, 2020

Copy link to clipboard

Copied

I have a bunch of scripts in my startup folder and each one creates an Object that contains its constants and functions. For example, a script may have:

 

// Create an object.
var CP = CP || {};
// Add a constant to the object.
CP.PT = 65536;
// Add a method to the object.
CP.applyPgfFmt = function (pgf, name, doc) {
    // Method code here...
};

 

My question: Is there a way to get a current list of these objects from ExtendScript while FrameMaker is running? Thank you very much. -Rick

TOPICS
Scripting

Views

790

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 , Apr 10, 2020 Apr 10, 2020

After poking around the "JavaScript Tools Guide" I found that I can do this to get the list I want:

var count, i;

count = $.global.reflect.properties.length;
for (i = 0; i < count; i += 1) {
    $.writeln ($.global.reflect.properties[i].toString ());
}

Votes

Translate

Translate
Community Expert ,
Apr 10, 2020 Apr 10, 2020

Copy link to clipboard

Copied

LATEST

After poking around the "JavaScript Tools Guide" I found that I can do this to get the list I want:

var count, i;

count = $.global.reflect.properties.length;
for (i = 0; i < count; i += 1) {
    $.writeln ($.global.reflect.properties[i].toString ());
}

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