Script Functions
DocOrigin script extensions consist of a number of additional functions and JavaScript objects that are predefined in the JavaScript environment. Some of these additional features are only available within certain programs (such as Merge) and are noted as such. Others are available for all DocOrigin programs.
Naming Conventions
In an attempt to reduce "name collision" between DocOrigin defined routines and ones you might write, most DocOrigin functions or objects use an underscore at the beginning of their name, such as _message()
or _chart.hBar()
. This convention is also used extensively in the Merge handling of DOM variables. See The Merge DOM section for more information.
Many of the DocOrigin extensions are provided under an umbrella JavaScript object whose properties and methods are used to access a common set of information. An example would be the _printer
o
bject - which has several methods (functions) such as _printer.getDocNum(), _printer.getPageCount()
etc. Another object might use a JavaScript property such as _auto.dataFile
, or in the case of the Merge DOM, Field._value
.
Functions and JavaScript Objects
Function/Object | Description | ||||||
---|---|---|---|---|---|---|---|
_auto | (Merge only) Script equivalent of the form automatic variables. | ||||||
_cache | (Merge only) Save data between Merge events or documents. | ||||||
_cacheInt(s) | (As of 3.0.003.28) Returns cache variable 's' as an integer. | ||||||
_cacheIncr(s) | (As of 3.0.003.28) Increments cache variable 's' by one. Returns incremented value. | ||||||
_chart | (Merge only) Create a BarChart, PieChart, or LineGraph. | ||||||
_data | (Merge only) Access the Merge data file (read-only). | ||||||
_dmessage | (Windows only) Display debug messages to the user. | ||||||
_document | (Merge only) Access the Merge document that's being created. | ||||||
_file | Read and write files. | ||||||
_isDJ() | Is optimized DocOrigin script running? | ||||||
_job (Current Job and Command Line Parameters) | Access command-line options and other job processing information.
| ||||||
_locale (Format Currency, Number, Date/Time) | Internationalized access to currency and date formatting. | ||||||
_logf | Write a message to the current logfile. | ||||||
_logfEx | Write a message to the current logfile with the severity level. | ||||||
_logPrintf | Write a message to both the logfile and stdout (console). | ||||||
_merge (Call DocOrigin Merge) | Invoke DocOrigin Merge. | ||||||
_mergeEmbedded | Do string substitution of field data | ||||||
_message | (Windows only) Display a message to the user. | ||||||
_metaData | Access metadata embedded in data streams. | ||||||
_os (Operating System Functions) | Access to select operating system functions. | ||||||
_page (The Page DOM) | (Merge only) Access Merge document current page. | ||||||
_parseInt(s) | (As of 3.0.003.28) DocOrigin equivalent of JavaScript parseInt() but with no hex or octal options. Always assumes a decimal-based integer string even if it starts with zero(s). | ||||||
_parser | Convert comma/tab-delimited data and fixed record data. | ||||||
_printer | (Merge only) Access/modify printer driver settings. | ||||||
_printf | Write a message to stdout (console). | ||||||
_profile (Access Profile Files) | (As of 3.0.004.02) Access Profile (.ini ) files. | ||||||
_prompt | (As of 3.1.002.06) Prompt user for input. | ||||||
_resolve | Do string substitutions in a provided template text string. | ||||||
_run (Execute Another Program) | Run any program. | ||||||
_runNoWait | Run any program. Do not wait for the result. | ||||||
_sendmail | Send an email message. | ||||||
_summary | (Merge only) Access/store summary data for Merge summary processing. | ||||||
_system | (Merge only) Access to certain Merge options. | ||||||
_toDOUnits | Convert various measurements to internal DocOrigin units (microns). | ||||||
_fromDOUnits | Convert internal DocOrigin units (microns) to various common measurements. | ||||||
_tracef | Write a message to the Trace file. (See -trace) | ||||||
_xml | (Merge only) Save xml data from Merge -filter processing. | ||||||
XmlFile Class (Write XML Files) | Create xml output files. | ||||||
XMLHttpRequest | Used to send requests to an http website and get a response. |
Predefined Variables
$X String Substitutions - all pre-defined $X-type variables.