🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9325

XML Element invalid after placing asset

#9325
From: Revier_Daniel
Date: Mon, 04 Sep 2006 21:22
33 lines
1807 bytes
I hope somebody can help me. I'm working for hours on this problem getting closer to the problem but can't solve it.

I have to functions. The first setAsset() get's the Indesign Page, the Library which is open and the XMLElement assetNode.

When i call the secont function placeMyAsset the assetNode is lost. The next function I want to call is setAssetContent(), but this throws already an error as the assetNode exists no more.

Any suggestions what might be wrong in my Script?

function setAsset(myPage, myLibrary, assetNode){
	if(assetNode.markupTag.name == "asset"){
		var assetName = getAttribute(assetNode, "name");
		var placed = placeMyAsset(myLibrary, myDoc, assetName)
		if(placed){
			var myAsset = myDoc.groups.lastItem();
			myAsset.move(myPage);
			//assetNode is lost!
			setAssetContent(myAsset, assetNode);
		}
	}	
}

function placeMyAsset(myLibrary, myDoc, assetName){
var placed = false;
	if(myLibrary.assets.item(assetName) != null){
		var myAsset = myLibrary.assets.item(assetName);
		myAsset.placeAsset(myDoc);
		placed = true;
	}
	return placed;
}

With regards,
Daniel
Technical Details
Message-ID: <3bc18824.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.motzarella.org!news.isoc.lu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d3ddd70d0fa9b296,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Revier_Daniel@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.motzarella.org!news.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: XML Element invalid after placing asset
Message-ID: <3bc18824.-1@webcrossing.la2eafNXanI>
Date: Mon, 4 Sep 2006 14:22:31 -0700
Lines: 37
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit