INdesign CS4

Purpose of script is to find the group, get the bounds, delete it, then replace it with spanish version grouping. The only problem is when moving the spanish version from a library and moving it the bounds i got from the english version the spanish verison is off by .0067 on both coordinates. Why is that? Shouldn’t it be placing it in the excact same location?

tell application "Adobe InDesign CS4"
	activate

	tell document 1
		set itemList to every item of all page items whose label is "Ass 16"
		select itemList
		set imageBounds to geometric bounds of selection
		
		set x to item 2 of imageBounds
		set y to item 1 of imageBounds
		
		delete itemList
	end tell

	set assetPlacer to place asset asset "Test" of library "RepSpan.indl" on active document
	move assetPlacer to {x, y}
	
end tell

Thanks in advance

The small difference is probably due to a stroke applied to your library asset. The reason for the imprecise placement is that move to coordinates use visual”not geometric”bounds. Unapply the stroke or calculate the difference between the two measurement systems and move a second time.

As Marc says, move is using the visual bounds. So change this:

       set imageBounds to geometric bounds of selection

to this:

       set imageBounds to visible bounds of selection

Thanks Guys!!! That’s exactly what I needed. Going to save tons of time on this job now. Keep up the good work.