Copyright (c) 2001-2007 PhatWare Corp. All rights reserved.
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 contain the following characters: # * < > @ and white space. The @ character is reserved to for system commands and cannot be used for user-defined commands. We strongly recommend that you use only a...z and 0...9 characters for PenCommand names. 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” (includes ‘#’ character), and “*test” (includes ‘*’ character). 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 a program, delay process execution, call a user defined function, etc.
Examples of PenCommands:
Add name, address, and phone number to the current text of a document
Insert a special symbol (e.g. ©, ®, ¥, ™…) to the text
Select all text in the current document and copy it to the clipboard
Open a spreadsheet file, e.g. “PHONES.XLS”
Create a new mail message
Open the “System” item in Control Panel
Print the current document
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.
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 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