JScript Examples
After you install MapForce, several JScript example files are available in the directory C:\Users\<username>\Documents\Altova\MapForce2024\MapForceExamples\API.
The example files can be run in one of two ways:
•From the command line:
Open a command prompt window and type the name of one of the example scripts (for example, Start.js). The Windows Scripting Host that is packaged with Windows will execute the script.
•From Windows Explorer:
In Windows Explorer, browse for the JScript file and double-click it. The Windows Scripting Host that is packaged with Windows will execute the script. After the script is executed, the command console gets closed automatically.
The following example files are included:
Start.js | Start Mapforce registered as an automation server or connect to a running instance. You can also view this code listing in Start Application. |
DocumentAccess.js | Shows how to open, iterate and close documents. You can also view this code listing in Simple Document Access. |
GenerateCode.js | Shows how to invoke code generation using JScript. You can also view this code listing in Generate Code. |
Readme.txt | Provides basic help to run the scripts. |
This documentation additionally includes a few extra JScript code listings: