Skip to content

You are not logged in. Register orLog In

start:

Developing Scripts on the Command Line

For users who do not wish to develop their OpenOffice.org scripts using an IDE there is a simple command line interface built into the OpenOffice.org Scripting module which can be used for the generation and deployment of OpenOffice.org Scripts.

Contents

Prerequisites

  • The Scripting module office.jar file should be included in the classpath. You can download this file from here
  • The main Scripting Framework jar file ScriptFramework.jar also needs to be included in the classpath. You can find it in the program/classes directory of your OpenOffice.org installation.
  • The CommandLineTools class will only work if an XML parser (such as Apache Xerces) is available in the classpath.

The CommandLineTools class

The CommandLineTools class takes the following options (Note: Options in angle brackets "<>" are required, options in square brackets "[]" are optional):
[-o Path to OpenOffice.org Installation] -g [Path to Parcel directory] [options]

Generates a Script Parcel for the given the parcel directory. The optional -o flag is used to specify that path to your OpenOffice.org installation. If it is not provided the CommandLineTools class will attempt to discover your OpenOffice.org installation and will print an error if it fails. The parcel name will be the name of the parcel directory plus the .sxp extension.

[-o Path to OpenOffice.org Installation] -d <Path to Script Parcel> <Target Directory|Document>

Deploys the given Script Parcel to a directory or an OpenOffice.org document. The optional -o flag is used to specify that path to your OpenOffice.org installation. If it is not provided the CommandLineTools class will attempt to discover your OpenOffice.org installation and will print an error if it fails. A directory will be created with the name of the Parcel and the contents of the Parcel will be put into that directory.

  • If deploying to an OpenOffice.org installation the target directory should be the <OpenOffice.org Installation>/user/Scripts or <OpenOffice.org Installation>/share/Scripts directory. If the either the Script Parcel or the target do not exist an error message is printed. Otherwise the Script Parcel is deployed to the target.

Top

Examples

Top


Last Modified: Nov 19 2003