Answered
Set Auto-Size on all text containers EXCEPT on frames with stroke color applied?
Hi everyone,
I'm wondering if it's possible to adapt the script below, so that it works with all text containers EXCEPT on frames with stroke color "New Gradient Swatch" applied? Any help would be greatly appreciated! 🙂
for (var d=0; d<app.documents.length; d++)
{
var myDoc = app.documents[d];
var allTextContainers = [];
var allStories = app.documents[d].stories.everyItem().getElements();
var allStoriesLength = allStories.length;
for(var n=0;n<allStoriesLength;n++)
{
allTextContainers =
allTextContainers.concat( allStories[n].textContainers );
};
var allTextContainersLength = allTextContainers.length;
for(var n=0;n<allTextContainersLength;n++)
{
if( allTextContainers[n].constructor.name == "TextPath" )
{ continue };
allTextContainers[n].textFramePreferences.autoSizingReferencePoint = AutoSizingReferenceEnum.TOP_CENTER_POINT;
allTextContainers[n].textFramePreferences.autoSizingType = AutoSizingTypeEnum.HEIGHT_ONLY;
allTextContainers[n].textFramePreferences.autoSizingType =
AutoSizingTypeEnum.OFF;
};
}
alert("Done!");
Thanks,
Rogerio
