app.scriptPerferences.version = 14.0
I have gotten releaseAnchoredObject() to work in some code I copied from online, but I'm still having trouble implementing it in the program I'm trying to write.
Why does the first section of code work, but the second does not?
var sList = app.activeDocument.stories[0];
//var sList = app.activeDocument.stories.everyItem().getElements();
var imageCollection = sList.splineItems;
for (var i = imageCollection.length - 1; i >= 0; i--)
{
myItem = imageCollection;
myItem.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
myItem.anchoredObjectSettings.releaseAnchoredObject();
} //ends for i loop
imageCollection = app.activeDocument.stories.everyItem().splineItems;
myItem = imageCollection[0];
myItem.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
myItem.anchoredObjectSettings.releaseAnchoredObject();
I have tried changing the first chunk of code to the block below, but it doesn't work
var sList = app.activeDocument.stories.everyItem();
var imageCollection = sList.splineItems;
for (var i = imageCollection.length - 1; i >= 0; i--)
{
myItem = imageCollection;
myItem.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
myItem.anchoredObjectSettings.releaseAnchoredObject();
} //ends for i loop
So I think it is a problem with the way I'm trying to use everyItem()
Also I don't know what line 9 in the first block of code (the one that works) is doing, but the code won't work without it.
Thank you for any help you can offer!