Article View: adobe.scripting.indesign
Article #10106Re: AS -- Checking Contents on Layers
From: Eric
Date: Wed, 05 Jul 2006 19:05
Date: Wed, 05 Jul 2006 19:05
31 lines
1839 bytes
1839 bytes
Basically you want to count every text box on the graphic layer and every graphic box on the text layer. If either count > 0, then you want to throw an error. The trick is that "every item" tends to throw an error if it fails, so remember to put them in "try" statements. This isn't a complete script (and it hasn't been compiled!) but it should be the basics of what you need:
--Retrieve bad text boxes
try
set textOnGraphLayer to every text frame whose layer = "GraphLayer"
on error
set textOnGraphLayer to {}
end try
--Retrieve bad graphics
try
set graphOnTxtLayer to every rectangle whose layer = "TxtLayer"
on error
set graphOnTxtLayer to {}
end try
--Count and display bad text boxes
if (count every item of textOnGraph > 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 txtOnGraphLayer
select thisItem
display dialog "Error: Selected graphic appears to be on TxtLayer" buttons "Cancel" default button 1
end repeat
end if
Technical Details
Message-ID:
<3bc0cfde.2@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!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.2@webcrossing.la2eafNXanI> Date: Wed, 5 Jul 2006 12:05:58 -0700 References: <3bc0cfde.-1@webcrossing.la2eafNXanI> Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing