Indesign CS3: making data merge more useful

Data merge is a useful function of the program but its scriptability is limited. I’ve searched this forum and found some scripts that run a pre-linked ID document. I’m trying to script the linking of fields with known text strings.

Looking at the dictionary I see that the only thing that has read/write is properties.


tell application "Adobe InDesign CS3"
	tell document 1
		set dm to data merge 1
		set p to properties of dm 
		--return p --> object ref, properties of data merge preferences of document 1, etc.
		return data merge preferences of p
		--> "data merge preferences of data merge properties of document "1" of application "Adobe InDesign CS3"
	end tell
end tell

Sounds like an endless loop to me. Is there anything useful in these preferences/properties that can help me reach my goal?

thanx, sam

Model: mac pro
Browser: Safari 525.27.1
Operating System: Mac OS X (10.5)

I still cannot let this go. It’s the last bit of puzzle for my solution.

As I stated elsewhere, I usually make an example and use AS to find its properties. I then reproduce it and figure it out. My goal is to take a list of data merge fields in an ID 3 document and iterate through each one to find its match in text and image boxes. The text works great and was my model for the image portion. But they’re failing to work for the image boxes. I use a Script Label for a box that matches the field name.

So to get it working, I looked again at the dictionary and constructed the following which would appear to work on paper. Perhaps some kind soul can see what I’m failing to see, thanx, sam


tell application "Adobe InDesign CS3"
	set c to object reference of document 1
	set a to object reference of selection --> selected picture frame
	set b to object reference of data merge field 11 of data merge properties of document 1 -->found through properties of data merge of document
	set myImagePlaceholder to make new data merge image placeholder with properties {field:b, placeholder page item:a, parent:c} --> result: "Adobe InDesign CS3 got an error: Can't make class data merge image placeholder."
end tell