Question
Use function details outside function
Hi,
I am using this function/code to get marker text. I want to use the output of this function in another function which I am unable to do so.
Is there a way to store/use the text2 outside this function?
#target framemaker
var doc, marker, nextMarker, regex, text2;
regex = /^newlink Filename\:.*/;
doc = app.ActiveDoc;
function getMarker(doc, text2){
marker = doc.FirstMarkerInDoc;
while (marker.ObjectValid () === 1) {
nextMarker = marker.NextMarkerInDoc;
if (marker.MarkerTypeId.Name === "Hypertext") {
if (regex.test (marker.MarkerText) === true) {
text2 = marker.MarkerText;
}
}
marker = nextMarker;
}
}
alert (text2);
