Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

Problems with ObjectValid ()

$
0
0

Dear experts,

In my scripts I have this snippet:

var tLoc2, fRange, j, thisMarker, thisId, thatId;
//...
for (j = 0; j < markerRange.length; j++)        // loop should not be necessary due to findparms
{ 
var oTextItem = markerRange[j]; 
thisMarker = oTextItem.obj;                   // should contain only one marker
} 
if (!thisMarker.ObjectValid()) {
Alert ("IndexNearestMarker does not find a " + sMarkerName + " marker after the cursor location, first marker used");
thisMarker =  markerArray[0];
}
thisId = thisMarker.Unique;

Although thisMarker shows all expected properties, and in the document the found marker is already selected, line 8 reports "thisMarker is undefined".

data-browser.png

Replacing line 8 with this

if (!oTextItem.obj.ObjectValid()) {

the sript runs and line 12 does not create a problem at all !

 

What is wrong with the original line 86?


Viewing all articles
Browse latest Browse all 888

Latest Images

Trending Articles



Latest Images

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