Placing asset from InDesign Library and changing anchor point

I have made an InDesign library to hold regularly used items. These items are of different sizes and are usually grouped items. I want to place these items on the page referencing the top left anchor of the group - using the x and y coordinates from the zero point.

I have a working (sort of) script but have only included a small snip hoping to illustrate my problem.

I can place asset on the page. I can move the grouped item on the page but the transform reference point is not in the right place. I want the point to be top left anchor. But the asset might come down as top right anchor positioning the asset in the wrong location. This is something I can do manually in the Control or Transform palette but cannot figure out how to move the item after placing it on the page using a different transform point.


– path to library file - temporary location
set tagsLib to (“CREATE_FLAT_MECH:ColorBarAndTags.indl”)

tell application “Adobe InDesign CS2”
activate
set newDoc to make document
tell active document
set properties of view preferences to {horizontal measurement units:millimeters, vertical measurement units:millimeters, show frame edges:false}
set properties of guide preferences to {guides shown:true}
set zero point of newDoc to {0, 0}
end tell
tell view zoom style of layout window 1 to fit page
tell newDoc
make new layer with properties {name:“TAGS & BARS”}
make guide with properties {orientation:vertical, location:100, item layer:layer “TAGS & BARS”}
make guide with properties {orientation:vertical, location:200, item layer:layer “TAGS & BARS”}
make guide with properties {orientation:horizontal, location:50, item layer:layer “TAGS & BARS”}
end tell
end tell

tell application “Adobe InDesign CS2”
if not (exists library “ColorBarAndTags”) then
set theFile to open tagsLib
end if
set active layer of active window to layer “TAGS & BARS” of newDoc
set asset4colorslug to place asset asset “4 COLOR SLUG” of library “ColorBarAndTags.indl” on newDoc
move asset4colorslug to {100, 50}
set asset4colorslugHor to place asset asset “4_COLOR_SLUG_HOR” of library “ColorBarAndTags.indl” on newDoc
move asset4colorslugHor to {200, 50}
end tell

Sorry - I read through your post twice and I still don’t get exactly what you are trying to do. What do you mean top left anchor point? Do you mean you want to use that as a reference and place the top left point of the group of items at that point? I think if I understood you issue better I could probably help you out.

Thanks
Chris

I’m sorry for not being clearer. I’m referring to the point of origin which can be set in the Control or Transform palette proxy. There are nine points. Top left anchor meaning top left point on this palette. I think you are getting what I mean that I want to re-set this point via AS.

Manually I can drag this file from the library to my page, re-set the point to top left anchor and move the item on the page in the x and y fields. I want to do the same thing via AS. Is my logic wrong?

ok - I think I understand what you want. this code will set the anchor point of the “reference point”

set transform reference point of layout window 1 to top left anchor

this is from the AS dictionary of CS2

transform reference point (anything) : The default anchor point to transform objects around. Can return: top left anchor/top center anchor/top right anchor/left center anchor/center anchor/right center anchor/bottom left anchor/bottom center anchor/bottom right anchor or list of 2 numbers o…

hope that helps

Chris