Scripts pane
The Scripts pane contains all of the scripts that are used to replace
data in a template, or to modify its look. Scripts can be exported and
imported via the buttons or through drag & drop between the Scripts
pane and any location on the computer.
Scripts included on the Scripts pane are completely distinct from the JavaScript resources
found in the Resources Pane (see Using JavaScript). Think
of scripts as server-side in the sense that they are executed through
the Connect modules (Server and Content Creation especially). Scripts
have access to the whole PReS Connect
JavaScript API (see Designer Scripts API), such as the record object. JavaScript resources, on the
other hand, are only executed after
the content creation is done, generally in a browser.
The scripts in the Scripts pane are always executed top-to-bottom. They can be dragged up or down in the pane to change their order of execution. For example,
content loading scripts ( with variable data, for instance) must come
before scripts that replace data within that loaded contents.
Buttons
- Import...: Click to open
a standard Open dialog to import a script. The script must have the
.OL-script extension.
- Export...: Click to open
a standard Save As dialog to save the currently selected scripts to
disk. These scripts can be re-used in other templates. If more than
one script is selected, they are all saved to a single file. If some
scripts are inside folders, this folder structure is kept and will
be restored when the scripts are imported.
- New: Displays a drop-down
that shows the following options:
- Script: Adds a new
empty basic script.
- Text
Script: The default script that is created when adding variable data to a template. See Variable data.
- Dynamic
Image script: Provided that its refers to an image, this script dynamically changes the image for each record. See Dynamic Images.
- Email scripts: Email scripts define the sender, recipients, subject etc. of the email that is sent, and the PDF password. See Email header settings.
- Control script: A Control script affects the output of a template per record as a whole, instead of parts of the content. See Control Scripts and Control Script API.
- Conditional
Content Script: This script can conditionally
show or hide any element in the template. See Showing content conditionally and Conditional script dialog.
- Folder: Adds a folder
in which scripts can be placed for easier management. See Script folders.
- Collapse All: Collapses
all the folders, hiding the scripts inside of them.
Scripts Pane column
- Name: The
name added to better identify the script.
- Selector: Displays
the initial text or selector that the script applies
to.
Fields from the Data Model pane can be dragged directly into the Scripts
pane to create a Text Script. Additionally, Text scripts can be dragged into any to add
the script's placeholder at the insert location.
See Variable data.
Contextual menu options
- Duplicate: Click to create
an exact copy of the script.
- Delete: Click to delete
the selected script. This does not delete any element or text in the template itself.
- Rename: Click to open a
dialog to rename the script. This is the same as changing the
Name field in the Edit Script window, which can be opened by double-clicking the script.
- Enable/Disable: Click to
trigger the script to be enabled or disabled. Disabled scripts are
greyed out and italic and will not be executed. See Enable/disable scripts
- Import: load a script from a Scripts file (*.OL-script).
- Export: save the script to a Scripts file (*.OL-script).
- Properties (Script folders only): edit the name and execution scope of the folder. See Execution scope.
|
|