Article View: adobe.scripting.indesign
Article #8425Re: Convert empty text frames to "unassigned"
From: Dave_Saunders
Date: Fri, 13 Oct 2006 11:02
Date: Fri, 13 Oct 2006 11:02
13 lines
1303 bytes
1303 bytes
This will get all such text frames except any that might be inline/anchored to type on a path if the path is that of a text frame.
myPIs = app.documents[0].allPageItems;
for (var j = myPIs.length - 1; j >= 0; j--) {
if (myPIs[j].constructor.name == "TextFrame" && myPIs[j].contents == "") {
try {myPIs[j].contentType = ContentType.unassigned} catch(e) {}
}
}
Note: if a text frame is threaded to a non-empty story, then you can't change the content type of that frame without first breaking it out of the story. That's what the try/catch is there for. The script just ignores any such frame. However, if the whole story is empty, then the frames will be converted.
Dave
Technical Details
Message-ID:
<3bc1f4d8.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.isoc.lu!news.stben.net!webcrossingReferences:
<3bc1f4d8.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,36cdad94baf5056 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Convert empty text frames to "unassigned" Message-ID: <3bc1f4d8.0@webcrossing.la2eafNXanI> Date: Fri, 13 Oct 2006 04:02:43 -0700 References: <3bc1f4d8.-1@webcrossing.la2eafNXanI> Lines: 17 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.isoc.lu!news.stben.net!webcrossing