How to change the vertical justification in Applescript

Community Beginner ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

This command does not seem to work:

set vertical justification of text frame preferences to bottom align

When I get the properties of the text frame, it does not include vertical justification.

 

TOPICS
Scripting

Views

99

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Mar 17, 2022 Mar 17, 2022
It should work, here are the get replies with 3 text frames in a layer named "Test Layer":

Likes

Translate

Translate
Adobe Community Professional , Mar 17, 2022 Mar 17, 2022
Does a repeat loop work? Something like this: tell application id "com.adobe.indesign" tell active document set tf to every text frame of layer "Test layer" repeat with x in tf set vertical justification of text frame preferences of x to bottom align end repeat end tell end tell

Likes

Translate

Translate
Adobe Community Professional ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

Hi @defaultzyz99fv4l764 , I think you need to target a text frame, so this would set the vertical justification of a selected text frame:

 

tell application id "com.adobe.indesign"
	set s to selection
	if class of item 1 of s is text frame then
		set vertical justification of text frame preferences of selection to bottom align
	end if
end tell

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

Or, if you are constructing text frames, something like this:

 

tell application id "com.adobe.indesign"
	set measurement unit of script preferences to inches
	tell page 1 of active document
		set tf to make text frame with properties {geometric bounds:{1, 1, 5, 5}, contents:"Hello", text frame preferences:{vertical justification:bottom align}}
	end tell
end tell

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

'sorry I didn't include the complete script. Here it is. Is this a valid script that should work?

 

tell application "Adobe InDesign 2022"

tell active document

tell every text frame of layer "Test layer"

set vertical justification of text frame preferences to bottom align

end tell

end tell

end tell

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

It should work, here are the get replies with 3 text frames in a layer named "Test Layer":

 

Screen Shot 11.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

LATEST

Does a repeat loop work? Something like this:

 

 

tell application id "com.adobe.indesign"
	tell active document
		set tf to every text frame of layer "Test layer"
		repeat with x in tf
			set vertical justification of text frame preferences of x to bottom align
		end repeat
	end tell
end tell

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines