Adobe 27510753 - InDesign CS2 - PC Manual page 42

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

34
Getting Started with InDesign Scripting
end tell
show
--Get the settings from the dialog box.
--Get the point size from the point size field.
set myPointSize to edit contents of myPointSizeField as real
--Get the example text from the text edit field.
set myString to edit contents of myTextEditField
--Get the vertical justification setting from the pop-up menu.
if selected index of myVerticalJustificationMenu is 0 then
else if selected index of myVerticalJustificationMenu is 1 then
else
end if
--Get the paragraph alignment setting from the radiobutton group.
get properties of myParagraphAlignmentGroup
if selected button of myParagraphAlignmentGroup is 0 then
else if selected button of myParagraphAlignmentGroup is 1 then
else
end if
--Remove the dialog box from memory.
destroy myDialog
end tell
tell page 1 of myDocument
set myTextFrame to make text frame
set geometric bounds of myTextFrame to my myGetBounds(myDocument, page 1 of myDocument)
--Apply the settings from the dialog box to the text frame.
set contents of myTextFrame to myString
--Apply the vertical justification setting.
set vertical justification of text frame preferences of myTextFrame to
--Apply the paragraph alignment ("justification").
--"text 1 of myTextFrame" is all of the text in the text frame.
set justification of text 1 of myTextFrame to myParagraphAlignment
--Set the point size of the text in the text frame.
set point size of text 1 of myTextFrame to myPointSize
end tell
end tell
on myGetBounds(myDocument, myPage)
tell application "Adobe InDesign CS2"
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
tell myDialogColumn
make static text with properties {static label:"Vertical Justification:"}
end tell
set myDialogColumn to make dialog column
tell myDialogColumn
set myVerticalJustificationMenu to make dropdown with properties
{string list:{"Top", "Center", "Bottom"}, selected index:0}
end tell
end tell
set myBorderPanel to make border panel
tell myBorderPanel
make static text with properties {static label:"Paragraph Alignment:"}
set myParagraphAlignmentGroup to make radiobutton group
tell myParagraphAlignmentGroup
set myLeftRadioButton to make radiobutton control with properties
{static label:"Left", checked state:true}
set myCenterRadioButton to make radiobutton control with properties
{static label:"Center"}
set myRightRadioButton to make radiobutton control with properties
{static label:"Right"}
end tell
end tell
set myVerticalJustification to top align
set myVerticalJustification to center align
set myVerticalJustification to bottom align
set myParagraphAlignment to left align
set myParagraphAlignment to center align
set myParagraphAlignment to right align
myVerticalJustification
Adobe InDesign CS2 Scripting Guide
¬
¬
¬
¬
¬

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents