Internal constants
The following constants are defined by KCM Core internally. You can use them in all scripts.
Constant | Value | Type |
---|---|---|
_date | The current date in "dd-MMM-yyyy" notation. The abbreviation of the month is not localized and always in English. | Text |
_dayofweek | The current day of the week. Sunday = 0, Monday = 1, and so on. | Number |
_document_pack | If a Document Pack is associated with the current session, this constant contains the path to the Document Pack content. If no Document Pack is associated with the current session, this constant is empty. | Text |
_error | This constant is set to True if the previous command caused an error; False otherwise. _error is set to False if the command succeeds, and to True if the command fails. The program non-zero return code resides in _returncode in the latter case. If the command started by RunCommand could not be started, _error is set to True and _returncode is set to 0. | Boolean |
_errorlocation | The script in which the last error occurred. | Text |
_expired_sessions | This constant contains a comma-separated list of expired sessions. The content is only valid after a successful ExpireSessions command. | Text |
_filedate | The current date in "yyyymmdd" notation. | Text |
_filetime | The current time in "hhmmssuuu" notation. | Text |
_hostname | Name of the machine on which the Document Processor accessing this constant is running. | Text |
_interface | KCM Core public client interface in "host:port" format. | Text |
_invalidchar | The Unicode REPLACEMENT CHARACTER (U+FFFD). | Text |
_itpext | Extension of the last result document. This value is set by the command ITPRun. This constant is available in KCM Core 4.4 and higher. | Text |
_itplog | Contents of the KCM Core ITPLOG file. This value is set by the command ITPRun. | Text |
_itplogdm | Contents of the KCM Core ITPLOGDM file. This value is set by the command ITPRun. | Text |
_itpstop | Contents of the KCM Core ITPSTOP file. This value is set by the command ITPRun and contains the value passed to the instruction STOP. | Text |
_jobid | The Job Identifier of the current request. | Text |
_message | The error message that caused an command OnError to be activated. This variable is set by the command OnError. | Text |
_newline | A line break character (U+000A). | Text |
_new_session | This constant contains the session ID of the last session that was created using the command CloneSession. The content is only valid after a successful command CloneSession. | Text |
_onlinefeaturelevel | The maximum KCM ComposerUI Server feature level supported by KCM Core. | Number |
_repository_metadata | The metadata associated with the object returned by the last RetrieveRepositoryObject command. | Text |
_restored_session | This constant contains the original session ID of the last session that was restored using the command RestoreSession. The content is only valid after a successful RestoreSession command. | Text |
_returncode | The following internal commands set _returncode: RunCommand, PrintDocument, ConvertDocument, RunMacro, SpoolFile, PStoPDF, CreatePDF, ConcatPDF, MergePDF, SecurePDF, and ITPRun. _returncode is set to 0 and _error to False if the command succeeds, and to the program non-zero return code and _error to True if the command fails. If the command started by RunCommand could not be started, _error is set to True and _returncode is set to 0. | Number |
_script | The current script being executed. | Text |
_server | The Microsoft Windows Service name of the Document Processor running the script accessing this constant. | Text |
_service | Text "Load Balancer Interface:" followed by the name of the KCM Core Service accessing this constant. | Text |
_session_active | This constant is set to True if the job is associated with a session; False otherwise. | Boolean |
_sessiondir | The storage directory for the current session. This variable is empty if the request is not associated with a session. | Text |
_sessionid | If the current job is associated with a session, this constant contains the session ID of that session. If the current job is not associated with a session, this constant is empty. | Text |
_servername | Name of the KCM Core installation. | Text |
_stderr | "Standard error" output of the last RunCommand. | Text |
_stdout | "Standard output" output of the last RunCommand. | Text |
_tab | A TAB character (U+0009). | Text |
_time | The current time in "hh:mm:ss" notation. | Text |
_uniqueid | This constant returns a new unique text string every time it is used. This constant is useful for generating unique file names. | Text |
_user | Owner of the request. | Text |
_version | The version of KCM Core. | Text |
_version_windows | The version of Microsoft Windows installed on the server hosting the KCM Document Processor. | Text |
_version_word | The version of Microsoft Word installed on the server hosting the KCM Document Processor. If Microsoft Word is not installed or KCM Core failed to determine the version, this value is empty. | Text |