What is ALD? > The Main Ways of Working with ALD > Automated Page Makeup, Document Composition, and Publication
  
Automated Page Makeup, Document Composition, and Publication
The ability to automate the creation of documents with templates, the addition and manipulation of content and the publish of resulting documents is a core feature of PTC ALD and one that will exact the highest ROI for any implementation. Where previously output was laid out and typeset by hand, PTC ALD's constituent components will permit the programmatic composition of documents of an equal quality, quickly and efficiently:
Macros
Macros control every action taken by PTC ALD, whether that be the setting of application preferences, the creation or invocation of dialog boxes, the running of a script or template or the initiation of a publishing process. Macros are stored in a queue created for each particular application and macros can be added to the queue via a variety of different methods. PTC ALD then works through the queue methodically, running each macro individually until the queue is empty.
JavaScript
An alternative programming method introduced with release 10.0. ALD applications can be coded via JavaScript, using application, template, and content object definitions as provided by ALD’s Formatting Object Model (FOM).
The inclusion of DOM handling capability with the FOM means that ALD can format directly from a DOM, and execute styles or FOM processing for events related to a node.
Scripts
A script is a list of PTC ALD macros that is run by a single trun macro. Scripts can be coded in PTC ALD's proprietary scripting language, or in Javascript, or in Perl, and can be nested to produce as complex a template as required. The inclusion of jumps and labels (and conditional formatting as detailed below) ensures that a single template can support multiple document types or instances in a particular application.
Rules
PTC ALD permits the addition of a rules-based structure to a template, thus allowing the allocation of properties or functions by context during the formatting and composition process.
Conditions and tests
PTC ALD's script extension has a condition tester that allows macros to be executed according to the result of an expression, adding an extra layer to the support for contextual formatting and composition. This ability is reinforced further by PTC ALD's ability to process variable information and expressions but these will be described in later sections of this document.
Communications
Direct low level communication between PTC ALD and its constituent composition engine means that composition is both fast and efficient.
It can be noted here that the WYSIWYG view (see WYSIWYG View ) of documents in the PTC ALD interface also supports the manual touch up of documents following an automated creation process. This will be described in more detail in the next section.