Scripts, ArcPad XML, and the ArcPad Object Model

Release 8 E-mail This Topic Printable Version Give Us Feedback

Depending on the type of customization you are doing in ArcPad Studio, you may need to become more familiar with scripts, ArcPad XML, and/or the ArcPad Object Model.

Working with scripts

Although a great deal of customization can be accomplished without writing a single line of code, the fundamental feature of ArcPad’s customization environment is the ability to use scripts. ArcPad exposes an extensive object model that can be accessed via Microsoft VBScript or JScript. These objects are available to your scripts whenever the ArcPad application is running.

Active Script is a comprehensive scripting infrastructure for the Microsoft Windows platform. Microsoft provides two implementations of the script engine interfaces, Visual Basic Scripting Edition and Microsoft JScript, which can be embedded into applications such as ArcPad.

ArcPad operates as an active scripting host for Microsoft’s VBScript or JScript. VBScript and JScript are standard scripting languages and relatively easy to learn.

Working with ArcPad XML

Whether you use scripts or not, all of ArcPad’s customization files are stored in ArcPad XML format. Familiarization with this format will allow you to work with any of the ArcPad customization files in any text or XML editor. The ArcPad XML format is designed as a protocol for automation and customization of ArcPad. It is based on the XML 1.0 specification and uses the same syntax as ArcXML wherever possible (especially for symbology). ArcPad XML files can be ANSI, UTF- 8, Unicode, or Unicode Big Endian encoded.

ArcPad XML files (.apa, .apx, and .apl) are displayed as a tree diagram which is directly related to the underlying XML structure of the files. ArcPad XML elements and attributes are displayed as branches in the tree. You can edit the files very quickly by simply double-clicking elements and attributes. There are also various editors to speed up development and editing of ArcPad XML files by providing a graphical environment. The Toolbar and Form editors are examples of these.

Working with the ArcPad Object Model

ArcPad exposes an extensive object model that can be accessed via VBScript or JScript. The ArcPad object model includes approximately 50 objects that are exposed while ArcPad is running. As long as ArcPad is running, you can access and manipulate these objects via VBScript or JScript. Once ArcPad is closed, all of the objects cease to exist until ArcPad is started again.