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".
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?