FrameMaker ExtendScript: Finding a list of user-defined objects

Adobe Community Professional ,
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

657

Likes

Translate

Translate

Report

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

1 Correct Answer

Adobe Community Professional , Apr 10, 2020
frameexpert Adobe Community Professional , 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 ()); }

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Community Professional ,
Apr 10, 2020

Copy link to clipboard

Copied

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 ());
}

Likes

Translate

Translate

Report

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