Article View: adobe.scripting.indesign
Article #10143Re: AS -- Checking Contents on Layers
From: Eric
Date: Thu, 06 Jul 2006 19:30
Date: Thu, 06 Jul 2006 19:30
43 lines
2211 bytes
2211 bytes
Well, here's a functional script. It actually selects each graphic or text box that is bad until there are none left, but it works otherwise. I ended up using a more reliable method to find graphic boxes (ie, ones that are ovals or polygons or whatnot). That's all I have time to do for now. Best of luck!
tell application "Adobe InDesign CS2"
tell active document
--Make layer names
set graphLayerName to "GraphLayer"
set txtLayerName to "TxtLayer"
--Retrieve bad text boxes
try
set txtOnGraphLayer to (every text frame whose name of item layer = graphLayerName)
on error
set txtOnGraphLayer to {}
end try
--Retrieve bad graphics
try
set graphOnTxtLayer to (parent of every item of all graphics whose name of item layer of parent = txtLayerName)
on error
set graphOnTxtLayer to {}
end try
--Count and display bad text boxes
if (count every item of txtOnGraphLayer) > 0 then
repeat with thisItem in txtOnGraphLayer
select thisItem
display dialog "Error: Selected text box appears to be on GraphLayer" buttons "Cancel" default button 1
end repeat
end if
--Count and display bad graphic boxes
if (count every item of graphOnTxtLayer) > 0 then
repeat with thisItem in graphOnTxtLayer
select thisItem
display dialog "Error: Selected graphic appears to be on TxtLayer" buttons "Cancel" default button 1
end repeat
end if
display dialog "No bad text or graphic layering found." buttons "Huzzah!" default button 1
end tell
end tell
Technical Details
Message-ID:
<3bc0cfde.4@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossingReferences:
<3bc0cfde.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,2ca5f3a3806465c X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Eric_@_MCA@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: AS -- Checking Contents on Layers Message-ID: <3bc0cfde.4@webcrossing.la2eafNXanI> Date: Thu, 6 Jul 2006 12:30:26 -0700 References: <3bc0cfde.-1@webcrossing.la2eafNXanI> Lines: 51 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing