🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #10184

Re: AS -- Checking Contents on Layers

#10184
From: Martin Fischer*
Date: Wed, 05 Jul 2006 06:49
43 lines
1917 bytes
Hi Pooja,

you can "move" every rectangle to layer "GraphLayer" and every text frame to layer "TxtLayer" like this:



 
tell application "Adobe InDesign CS2" 
	tell active document 
		-- "move" rectangles to layer "GraphLayer" and text frames to layer "TxtLayer" 
		set item layer of rectangles to layer "GraphLayer" 
		set item layer of text frames to layer "TxtLayer"

		-- count items of layers 
		set myGraphs to count of (page items whose name of item layer is "GraphLayer") 
		set myTxts to count of (page items whose name of item layer is "TxtLayer") 
		display dialog "GraphLayer items: " & myGraphs & "\rTxtLayer items: " & myTxts 
	end tell 
end tell 




Or you may iterate thru every page item and take a look at its layer (and do something if item layer is TxtLayer).



 
tell application "Adobe InDesign CS2" 
	tell active document 
		set myPageItems to page items 
		repeat with oneItem from 1 to count of myPageItems 
			if item layer of item oneItem of myPageItems is layer "TxtLayer" then 
				display dialog ((class of item oneItem of myPageItems as string) & " found on layer \"TxtLayer\"") 
			end if 
		end repeat 
	end tell 
end tell 




Martin
Technical Details
Message-ID: <3bc0cfde.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing
References: <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: "Martin Fischer*" <martin.fischer@online.de>
Newsgroups: adobe.scripting.indesign
Subject: Re: AS -- Checking Contents on Layers
Message-ID: <3bc0cfde.0@webcrossing.la2eafNXanI>
Date: Tue, 4 Jul 2006 23:49:58 -0700
References: <3bc0cfde.-1@webcrossing.la2eafNXanI>
Lines: 43
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing