On this Page

    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 object - 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/ObjectDescription
    _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.
    _fileRead 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.

    _job.commandFor command-line options
    _job.filterFor filter options
    _job.optionsFor job options set in a Job Name Discovery script or found on a <?DocOrigin ...?> Processing Instruction. (See Job Name Discovery).
    _locale (Format Currency, Number, Date/Time)Internationalized access to currency and date formatting.
    _logfWrite a message to the current logfile.
    _logfExWrite a message to the current logfile with the severity level.
    _logPrintfWrite a message to both the logfile and stdout (console).
    _merge (Call DocOrigin Merge)Invoke DocOrigin Merge.
    _mergeEmbeddedDo string substitution of field data
    _message(Windows only) Display a message to the user.
    _metaDataAccess 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).
    _parserConvert comma/tab-delimited data and fixed record data.
    _printer

    (Merge only) Access/modify printer driver settings.

    _printfWrite 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.
    _resolveDo string substitutions in a provided template text string.
    _run (Execute Another Program)Run any program.
    _runNoWaitRun any program. Do not wait for the result.
    _sendmailSend an email message.
    _summary(Merge only) Access/store summary data for Merge summary processing.
    _system(Merge only) Access to certain Merge options.
    _toDOUnitsConvert various measurements to internal DocOrigin units (microns).
    _fromDOUnitsConvert internal DocOrigin units (microns) to various common measurements.
    _tracefWrite 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.
    XMLHttpRequestUsed to send requests to an http website and get a response.

    Predefined Variables

    $X String Substitutions - all pre-defined $X-type variables.