🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8803

AS Placing asset from Library and changing anchor point

#8803
From: Bill_Castillo
Date: Tue, 26 Sep 2006 19:01
36 lines
2921 bytes
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
Technical Details
Message-ID: <3bc1c951.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.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.isoc.lu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,8c38420b97cfed9f,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bill_Castillo@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.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.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: AS Placing asset from Library and changing anchor point
Message-ID: <3bc1c951.-1@webcrossing.la2eafNXanI>
Date: Tue, 26 Sep 2006 12:01:56 -0700
Lines: 53
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit