Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Re: Associating a condition with a paragraph/char format

$
0
0

See if the code below makes sense to you.

 

#target framemaker

var pgfName; // Global variable.
setupNotifications ();

function setupNotifications () {
        // Set notifications for before and after functions.    Notification(Constants.FA_Note_PostFunction, true);    Notification(Constants.FA_Note_PreFunction, true);

}

function Notify (note, object, sparam, iparam) {
        // Handle the pre- and post-function events.    switch (note) {        case Constants.FA_Note_PreFunction :            if (object.constructor.name === "Doc") {                 pgfFmtName = getPgfFmtName(object);            }        break;                case Constants.FA_Note_PostFunction :            if (object.constructor.name === "Doc") {                alert (pgfFmtName); // Paragraph format name before function.                alert (getPgfFmtName(object)); // Paragraph format name after function.            }        break;    }
}

function getPgfFmtName (doc) {
        var pgf = doc.TextSelection.beg.obj;    if (pgf.ObjectValid() === 1) {        return pgf.Name;    }    else {        return "";    }
}

Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>