EasyManua.ls Logo

Adobe 0046100128056 - InDesign - Mac - Basic Page Layout

Adobe 0046100128056 - InDesign - Mac
209 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CHAPTER 3: Documents Basic Page Layout 22
//Use SaveOptions.yes to save the document,SaveOptions.no to close the
//document without saving, or SaveOptions.ask to display a prompt. If
//you use SaveOptions.yes, you'll need to provide a reference to a file
//to save to in the second parameter (SavingIn).
//Note that the file path is provided using the JavaScript URI form
//rather than the platform-specific form.
//
//If the file has not been saved, display a prompt.
if(app.activeDocument.saved != true){
app.activeDocument.close(SaveOptions.ask);
//Or, to save to a specific file name:
//var myFile = File("/c/myTestDocument.indd");
//app.activeDocument.close(SaveOptions.yes, myFile);
}
else{
//If the file has already been saved, save it.
app.activeDocument.close(SaveOptions.yes);
}
You can close all open documents without saving them, as shown in the following script fragment (from
the CloseAll tutorial script):
for(myCounter = app.documents.length; myCounter > 0; myCounter--){
app.documents.item(myCounter-1).close(SaveOptions.no);
}
Basic Page Layout
Each document has a default page size, assigned number of pages, bleed and slug working areas, and
columns and margins to define the area into which material is placed. Again, all these parameters are
accessible to scripting, as shown in the examples in this section.
Defining page size and document length
When you create a new document using the InDesign user interface, you can specify the default page size,
number of pages, page orientation, and whether the document uses facing pages. To create a document
using InDesign scripting, use the
documents.add method, which does not specify these settings. After
creating a document, you can use the
documentPreferences object to control the settings, as shown in
the following script fragment (from the DocumentPreferences tutorial script):
var myDocument = app.documents.add();
with(myDocument.documentPreferences){
pageHeight = "800pt";
pageWidth = "600pt";
pageOrientation = PageOrientation.landscape;
pagesPerDocument = 16;
}
NOTE: The app object also has a documentPreferences object. You can set the application defaults for
page height, page width, and other properties by changing the properties of this object. You can also set
individual page sizes; see “Adjusting Page Sizes and Layout”
.

Table of Contents

Related product manuals