🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by jsantaelena Sun, 10 May 2009 05:16
From XMLElement to Page Item
#217
Author: jsantaelena
Date: Sun, 10 May 2009 05:16
6 lines
1325 bytes
Hi All,

How can I get a Graphic or Text frame associated to a XMLElement from
this XMLElement?

Thanks;
Re: From XMLElement to Page Item
#219
Author: seuzo
Date: Thu, 21 May 2009 00:13
32 lines
2160 bytes
Hi, jsantaelena

//Return Hash
function collectPageItem() {
	var my_collection = new Array();
	var my_doc = app.activeDocument;
	for (var i = 0; i < my_doc.allPageItems.length; i++) {
		var tmp_key = my_doc.allPageItems[i].associatedXMLElement;
		if (tmp_key != null) {my_collection["id" + tmp_key.id] =
my_doc.allPageItems[i];}
	}
	return my_collection;
}

//Return pageitem object from XMLElement
function getPageItem(my_element, my_collection) {
	var tmp_key = "id" + my_element.id;
	return my_collection[tmp_key];
}

var my_doc = app.activeDocument;
var my_root = my_doc.xmlElements.item("records");//root element
var my_element = my_root.xmlElements[1];//targetelement

var my_collection = collectPageItem();
var my_obj = getPageItem(my_element, my_collection);
my_obj.select();//select test


--
Seuzo
http://www.seuzo.jp/
Re: From XMLElement to Page Item
#220
Author: seuzo
Date: Thu, 21 May 2009 00:28
6 lines
1504 bytes
As Applescript. see,
http://cross-the-sea.blogspot.com/2009/05/how-to-get-reference-of-page-item.html

--
Seuzo
http://www.seuzo.jp/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads