Home › Forums › General XMetaL Discussion › how do i iterate a document › Reply To: how do i iterate a document
Reply to: how do i iterate a document
March 20, 2014 at 1:36 amPlease have a look at the XMetaL Developer Programmers Guide documentation for this API as it contains some useful information that will help here.
Essentially this API returns a boolean value set to true/false when it finds/does not find what you are asking it to locate. So, your script logic can include something similar to the following:
[code]//XMetaL Script Language JScript:
if(Selection.Find.Execute(“SWNameLong”)) {
Application.Alert(“found it”);
}
else {
Application.Alert(“unable to find it”);
}[/code]
Hopefully you can integrate that type of logic into your script.
Aside: I'm not sure why your script uses both Selection and Range objects, but it is a script snippet after all and you don't show how you are setting up the Range or subsequent usage of it. Maybe there is a good reason for that.