🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #2099

Swatch to Layer InDCS2...

#2099
From: thiyagus5
Date: Sat, 03 Jan 2009 13:02
28 lines
1534 bytes
Hi everyone,

We have more than hundreds of InDesign documents. What we have to do is, turned off this "IE-Black" spot color swatch applied paragraphs in the document. So i am finding "IE-Black" spot color applied paragraphs in the documents then apply "ANNO" named layer to the corresponding paragraphs text frames. And finally hiding them all. If i have tested this script in the new document its working fine. But not working in our exiting documents. It showing error like,

------
Error Number:45
Error string:Object is invalid
Line:12
------

Please find my script below;

----
var myDoc = app.activeDocument;
with (myDoc){
	myNewLayer = layers.add();
	with (myNewLayer) {
	name = "ANNO"
	}
}
var mySwatch = myDoc.swatches.item("IE-Black");
for (i=0; i<myDoc.textFrames.length; i++){ if (myDoc.textFrames[i].paragraphs[0].fillColor == mySwatch ) 			{ myDoc.textFrames[i].itemLayer=myNewLayer; 			} } myNewLayer.visible=false;

alert ("DONE...")
----

Thanks in advance
Thiyagu
Technical Details
Message-ID: <59b76a5b.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,861aec667a920b14,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: thiyagus5@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Swatch to Layer InDCS2...
Message-ID: <59b76a5b.-1@webcrossing.la2eafNXanI>
Date: Sat, 3 Jan 2009 05:02:22 -0800
Lines: 40
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit