Align text to top of box in InDesign CS3

Hello,

I would like to set vertical alignment of text in InDesisign CS3 text box to top, but I go error message.

What I do wrong?

Rotation angle work, but vertical alignment no!


tell application "Adobe InDesign CS3"
	tell document 1
		set MyCounter to 1
		set mySelection to selection
		set MyRectangles to (count mySelection)
		
		repeat with i from 1 to MyRectangles
			set MyCounter to MyCounter + 1
			set rotation angle of item i of mySelection to 22
			
			set vertical alignment of item i of mySelection to top align
			
			
		end repeat
	end tell
end tell


Normunds

Hi Normunds,

If you haven’t done so already, please look up the entry for class “text frame” in InDesign’s AppleScript dictionary; you’ll see a list of acceptable properties. What you’ve termed vertical alignment is actually the vertical justification property of the property text frame preferences.

Hi normundsb

The below will align to either top, center or bottom, pending on your requirements.

tell application "Adobe InDesign CS3"
	tell document 1
		set MyCounter to 1
		set mySelection to selection
		set MyRectangles to (count mySelection)
		repeat with i from 1 to MyRectangles
			set MyCounter to MyCounter + 1
			set rotation angle of item i of mySelection to 22
			tell mySelection
				set vertical justification of text frame preferences of item i to top align
				--or
				--set vertical justification of text frame preferences of item i to center align
				--or
				--set vertical justification of text frame preferences of item i to bottom align
			end tell
		end repeat
	end tell
end tell

Budgie