This content has been marked as final. Show 3 replies
You've shown us one line only of your script. Are you sure that it is always executed before you do your search? Are you sure that at some other point in your script you don't switch that option back on?
Thanks for your quick reply.
Actually, I think I've figured out the problem. And it isn't exactly as I posted it...
The script cycles through each paragraph in the active document for which nested styles are defined. It returns an alert when the search string (a nested style delimiter) is *not* found in a given paragraph. I'm getting this alert for paragraphs in the master spread.
Essentially, since my Grep preferences say don't search master spreads, then the search operation will never find the search string in the master spread paragraphs, right? So I'll get the alert every time. Does this seem like the proper interpretation of what's going on?
So, perhaps what I need to do is test that the current paragraph is not in a master spread before triggering the alert. Or, better yet, test at the beginning whether the parent of a given story is a master spread before I even bother to search it.
Looking at the object model, it's not immediately clear how to do this. Can one test if the parent of a given story is a master spread? (I see from previous posts that this would likely happen via the frames and pages axes, but I'm not able to make it happen...)
If you use the function in this thread:
to find the page, you can then check to see if the parent of the page is a Spread or a MasterSpread.