NewDocument Document Command

NEWDOCUMENT Document Commands

Creates a new document.

newdocument

name/s The new document's name.

Results:

Returns the new document's name to RESULT. If the document name specified for the new document is already used by an open document, PageStream will append .# to it, so you may wish to check the result.

Notes:

This command is not equivalent to the menu's New command. It does not create a default master page or open a document window. To create a master page, follow this command with a newmasterpage command, and then open its window with the openwindow command.

Examples:

newdocument 'Report.document'

 

NewDocument  Command Definition  url:PGScmd/newdocument
  created:2006-03-30 17:19:29   last updated:2006-03-30 17:19:29
  Copyright © 1985-2024 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For NewDocument
Dan Kilroy wrote...2006-05-04 15:06:57

Script command submitted from PageStream internal documentation. Needs to be checked and merged with the command documentation above.

Gets the {...} .

docname = NewDocument (documentname)


Parameters:


Results:


Notes:


See Also:


Examples:
Python:


ARexx:

Applescript:

Tim Doty wrote...2006-08-09 19:41:33

Python:

myDoc = NewDocument('New Document')['.result']
NewMasterPage('New Masterpage', '8.5i', '11i')
myChapt = NewChapter('New Chapter',1)
OpenWindow(myDoc)

Note that the chapter name is prefixed with a colon. Colons are used to delimit designations in script. For example the full specification for the chapter in the forgoing example is New Document:New Chapter.

Normally you want the masterpage to have margins indicated and possibly guides as well.

Python:

SetMarginGuides(.75, .25, 1, .5)

The margin guides are in the order of: left/inner, right/outer, top and bottom. For greater clarity and reliability the units can be specified with the margin distance.

Python:

AddGuides('Vertical', 'AT', 2.5)
AddGuides('Vertical', 'AT', "2.5i", 'MPG', 'New Masterpage:right')

Both commands produce the same guide, but the first uses the default measurement system and so could be 2.5 inches or 2.5 centimeters (or something else) and adds a guide to the current masterpage. The second specifies the unit of measure to be used (inches) and the masterpage the guide should be added to.

User Contributed Comments For NewDocument