InDesign reference points to manipulate an object

Screenshot 2023-01-27 at 12.01.50 PM
In the upper left corner of InDesign is that Reference Point tool. Choosing the point determines where your manipulation is based around (I know you all know this).

Where in applescript is that referenced and/or set to?
I would like to add to my “reset script” to make sure that is always the center point.
I have never been able to figure out what it’s called in the dictionary.

Is this something we have control over?
David Klucznik

I think you want the “anchor point”
(From the ID dictionary)

anchor point

anchor point (enumeration)

CONSTANTS

||Constant|Description|

|bottom center anchor|The center point on the bottom of the bounding box.|
|bottom left anchor|The bottom left corner.|
|bottom right anchor|The bottom right corner.|
|center anchor|The center point in the bounding box.|
|left center anchor|The center point on the left side of the bounding box.|
|right center anchor|The center point on the right side of the bounding box.|
|top center anchor|The center point on the top of the bounding box.|
|top left anchor|The top left corner.|
|top right anchor|The top right corner.||

That doesn’t really help me.
I have tried all sorts of approaches.

tell application "Adobe InDesign 2023"
	activate
	tell anchored object defaults
		set anchor point to top right anchor
	end tell
end tell

I’m just looking for something like this to start. When I run this I should be able to change that “top right anchor” text and make the anchor move around, but I can’t.

I have actually pursued this specific topic for years to no avail.

david

See if this works…

tell application "Adobe InDesign 2022"
   tell document 1
   	get anchored object defaults
   	set existingAnchorPoint to anchor point of anchored object settings of anchored object style of anchored object defaults
   	set anchor point of anchored object settings of anchored object style of anchored object defaults to top right anchor
   	set newAnchorPoint to anchor point of anchored object settings of anchored object style of anchored object defaults
	end tell
end tell

might work in 2022… but if you run through it…
add the “make new document at beginning” to there’s a document
if I add in a display dialog to see the value of “ExistingAnchorPoint” I get ANbr as a result
“NewAnchorPoint” then equals ANtr

but the point doesn’t change in the control strip in the upper left corner.

david

Anchor object default is for boxes embedded inside an other box.
(like an image pasted in a text frame)

Here you are:

tell application id "com.adobe.InDesign" -- Adobe InDesign 2023
	set transform reference point of layout window 1 to center anchor
end tell

# POSSIBLE VALUES:
-- 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
3 Likes

That works great… thanks…

Is there a way to set that value without a window open?

I can probably make this work

thanks
david

No. You can’t. But the setting is persistent. Even after restart.

Created an account simply to come here and say thanks for this!

You’re welcome. Glad it could help you.