• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

199

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

Community Expert , Mar 17, 2022 Mar 17, 2022

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

 

Screen Shot 11.png

Votes

Translate

Translate
Community Expert , 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

 

 

Votes

Translate

Translate
Community Expert ,
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

Votes

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 Expert ,
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

 

Votes

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

Votes

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 Expert ,
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

Votes

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 Expert ,
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

 

 

Votes

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