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

Re: How can I autorun a script that will process an XML file on open?

$
0
0

The Notify event receives four parameters: note, object, sparam, and iparam. For the event you are using, object should be the document object of the FrameMaker document being opened. So, you should be able to use this:

 

doTheWork(object);

 

Make sure you update your doTheWork function to receive the Doc object:

 

function doTheWork(doc) {    var flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;    flow = doc.MainFlowInDoc;    root = flow.HighestLevelElement; // will always get something even if unstructured document    while(root.ObjectValid()) { //only do something for structured docs        elemName = getElementName(root);        ...more code to do stuff....    }
}

 

-Rick


Viewing all articles
Browse latest Browse all 3715

Trending Articles



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