Hi,
I’m trying to change the vertical justification of a text box, while the text tool is active.
I cannot find the right way to make the active text frame the selection.
I tried something like this.
tell application “Adobe InDesign CS6”
set myVerticalJustification to justify align
set myFrame to active text frame
set vertical justification of text frame preferences of myFrame to myVerticalJustification
end tell
tell application "Adobe InDesign CS6"
set myDocument to active document
set myFrame to selection
set theProps to properties of item 1 of myFrame
tell text frame preferences of theProps
set vertical justification to justify align
end tell
end tell
Ok, thanks, but this only work with the selection tool (black arrow).
I already got this with
tell application “Adobe InDesign CS6”
set myVerticalJustification to justify align
set vertical justification of text frame preferences of selection to myVerticalJustification
end tell
Your code is more secure,
but I need a script to work with the text tool, in the text frame where the insertion cursor is.
tell application "Adobe InDesign CS6"
set ParentFrame to parent text frames of item 1 of selection
if (count of ParentFrame) is 1 then set ParentFrame to item 1 of ParentFrame
set vertical justification of text frame preferences of ParentFrame to justify align
end tell