Overview

What is PenCommand?

A PenCommand is a sequence of instructions that are performed when a command is called.  Each PenCommand has a name.  The name can be any sequence of ASCII symbols up to 11 symbols. It cannot start with ‘#’ or ‘*’.  Examples of correct PenCommand names include:  “select”, “address”, “sel”, “phones”, “spell”, “date”, “news”, “mail”, and “a23”.  Incorrect names include: “my_home_address” (too long), “#account” (starts with ‘#’), and “*test” (starts with ‘*’).  PenCommand Names are case insensitive.  For example, “BTW”, “Btw” or “btw” are all recognized as the same name.

 

There are various categories of elementary instructions that can be used to build PenCommands. For example,   “type predefined text”, “start program”, “delay execution”, “call user defined function”, etc.  

 

Examples of PenCommands:

 

 

PenCommands are written in PenCommander Script. A simplified form of PenCommand is a “Text Only” command.  To create and edit Text Only PenCommands, you do not need to know the scripting language. You can use the Add PenCommand Wizard to create new Text Only PenCommands quickly and easily.

PenCommander Scripting Language

PenCommand Definition (extension) describes the sequence of instructions comprising the command. Its format:

 

<CommandID_1>[Parameters1] <CommandID_2>[Parameters2] … <CommandID_N>[ParametersN]

Command_X – command identifier ( e.g. “#type”, “#start”,  “#delay”)

ParametersX – parameter string, which consists of ASCII text and special symbols;

<> - angular brackets are part of script syntax for commands and special symbols;

[ ] – square brackets mean optional elements.

 

Command ID and special symbol names are case insensitive.

 

Examples of single-instruction PenCommand Definitions include:

 

<#start>pword “\My Documents\phones.doc"

// start Pocket Word Application with \My Documents\phones.doc file

 

<#type>Sincerely yours,<*return><*tab>John
// type “Sincerely yours,”, then type “John” on new line after tabulation

 

The last example includes two special symbols <*tab> and <*return>.

 

New line symbols (CR-LF) in script text are ignored. You can use them anywhere to make text more easy readable, e.g. the example above can be written this way:

 

<#type>Sincerely yours,<*return>

<*tab>John

 

To insert the symbol “<” into the parameter string, write “<<”, for example:

 

// type "sometimes 1<2"

<#type>sometimes 1<<2    

 

Some examples of more complex PenCommand definitions:

 

// call PenCommand with name "all"

<#macro>all      

 

// then delay for 1 sec.

<#delay>1000     

 

// then open PenOffice’s Corrector Window;

<#corr>          

 

// Ask for a program name through a dialog and place the answer in a string

<#askstr>Enter program file name:

// Then execute the program with the name from the string variable

<#start><*str>

 

The last example uses “string variable”.  Variables will be discussed in the next section.

 

PenCommander execution process

PenCommander interprets instructions from the definitions of its commands one by one until the end of the definition.  Some instructions can return a non-success return code (e.g. “Load library”,  “Ask variable” etc.), in which case the execution of a PenCommand is interrupted and the error handler instruction is performed (if defined).

 

See Also

Examples