How to define .everyItem().getElements() ?
Copy link to clipboard
Copied
Hi experts,
my script like this:
var myDocs = app.activeDocument;
var mMasters = myDocs.masterSpreads.everyItem().getElements();
var cObjectsTextFrame = mMasters.textFrames.everyItem().getElements();
if (!cObjectsTextFrame.contents || !cObjectsTextFrame.contents.match(/\S/) ) cObjectsTextFrame.remove();
not working on
.everyItem().getElements()
could some one please tell me how to define .everyItem().getElements()
thanks
regard
John
Copy link to clipboard
Copied
Hi,
It is easier to use it all in one line , if possible,
var myTextFrames = myDocs.masterSpreads.everyItem().textFrames.everyItem().getElements();
After that you need to loop through the myTextFrames as this will be an array of all the items that where found.
The main advantage of everyItem is that you can simplify your loops (normally you can reduce it to one loop).
Regards
Malcolm

