🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14976

[JS] Add XML tags to all graphics?

#14976
From: pjredman
Date: Wed, 07 Jan 2004 19:15
14 lines
1214 bytes
I'm trying to add a "Figure" XML tag to all of the graphics in the active document but am having trouble with the document.allGraphics object. Here's my script:
----------------------------
var myDoc = app.activeDocument;
var myGraphics = myDoc.allGraphics
var myGraphic
for(i = 0; i < myGraphics.length; i++){
		myGraphic = myGraphics.item(i);
		myDoc.xmlElements.item("Root").xmlElements.add("Figure", myGraphic);
	}
-----------------------------
InDesign returns the error "allGraphics.item() is not a function". How do I iterate through all of the graphics in the document?

Thanks,
Phil Redman
Technical Details
Message-ID: <2ccf3d9d.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e9c87384022b9c4b,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-07 11:37:58 PST
From: pjredman@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: [JS] Add XML tags to all graphics?
Message-ID: <2ccf3d9d.-1@webx.la2eafNXanI>
Date: Wed, 7 Jan 2004 11:15:46 -0800
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit