Javascript - Adobe 65024872 - InDesign CS4 - Mac Manual

Scripting guide
Hide thumbs Also See for 65024872 - InDesign CS4 - Mac:
Table of Contents

Advertisement

Adobe InDesign CS4 Scripting Tutorial
end tell
end tell
--myGetBounds is a handler that returns the bounds
--of the "live area" of a page.
on myGetBounds(myDocument, myPage)
tell application "Adobe InDesign CS4"
tell document preferences of myDocument
end tell
tell margin preferences of myPage
end tell
end myGetBounds
3. Save the script as a plain text file with the file extension
"Installing scripts" on page
Once you've opened or created the script file, you can run the script from the Script Editor or from the
InDesign Scripts panel.

JavaScript

Make sure you have the Hello World document open—this script relies on objects we created in that
script. If you closed the document without saving it, simply run the
a new document.
Either open the
script:
tell text frame 1 of page 1
--Resize the text frame to match the page margins.
set geometric bounds to myBounds
tell paragraph 1
--Change the font, size, and paragraph alignment.
try
set applied font to myFont
end try
set point size to 72
set justification to center align
end tell
end tell
myPageWidth to page width
set myPageHeight to page height
if side of myPage is left hand then
set myX2 to left
set myX1 to right
else
set myX1 to left
set myX2 to right
end if
set myY1 to top
set myY2 to bottom
end tell
set myX2 to myPageWidth - myX2
set myY2 to myPageHeight - myY2
return {myY1, myX1, myY2, myX2}
6).
ImprovedHelloWorld.jsx
.applescript
tutorial script, or perform the following steps to create the
Adding features to "Hello World" 26
in the Scripts Panel folder (see
script again to make
HelloWorld.jsx

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs4

Table of Contents