This is a concise reference for Teikei - a Palm Desk Accessory (DA) that allows frequently used chunks of text to be entered from pop-up lists. Full documentation is available in Japanese at: http://www010.upp.so-net.ne.jp/quni/.

Teikei is a Palm Desk Accessory (DA) and needs a launcher, such as DALauncher in order to pop it up over other applications. On pop up it displays up to five lists of macros each of which can insert text, pop-up a sub-menu, manipulate the time and date or prompt for input from the user.

Each list of macros is configured in a separate Memo with title:

TeikeiX;<name>

Where X is A..E (for lists A to E) and is the name of the list. For example:

TeikeiA;Contexts

might be a list of GTD Context names for easy insertion. Only the lists used need to be configured and the memos can be in any category.

Each of the following lines in the memo configures a macro. These can take the format:

<name>;<macroText>

or simply

<macroText>

In the first format the is displayed in the macro list and when tapped is executed. In the second example the is displayed in the macro list and executed if tapped.

Macro text is output to the currently selected text field. If the text contains a dollar sign the next two characters are examined to identify a command to be carried out. The dollar sign and command characters are not output to the text field. See the listings below for the commands that can be embedded in macros.

Here’s an example memo that defines macro list A:

TeikeiA;GTD
@Home
@PC
@Shops;@Shops$\n
@Work;@Work$\n
Today;$dd-$mm-$y2
Tomorrow;$d+$dd-$mm-$y2
Date;$di$dd-$mm-$y2

The first line indicates this configures list A which should be displayed with title “GTD”. The first macro is both displayed as ‘@Home’ and sends those characters to the output. However the third macro is listed as ‘@Shops’ but outputs that context followed by a Carriage Return.

The ‘Today’ macro outputs the current date in the format 19-09-06 (DD-MM-YY). The ‘Tomorrow’ macro increments the date by one day before outputing it. Finally the ‘Date’ macro prompts the user for the date and then outputs it in the same format as used by the other macros.

Teikei maintains its own date buffer that holds a timestamp for date and time calculations. When Teikei is launched the buffer is initialised with the current date and time. However it can be modified by user input of the date or time, or by date calculations.

Special Characters

These macro commands send special characters to the output text field.

Output Dollar Sign - $$$

The dollar symbol is used as a delimiter for commands. Teikei expects a dollar to be followed by two characters that specify the command to be executed. In this command the first dollar is the delimiter, indicating that the next two characters are a command. The second and third dollars are the name of the command that issues a single dollar sign as its output.

Carriage Return - $\n

Outputs a Carriage Return.

User Input

These macro commands prompt the user to input values that can then be used in the rest of the macro.

Display Pop-up List - $sl<popUpMemo>$sl

The select macro allows a pop-up list of text strings to be displayed. Tapping on an entry in the pop-up outputs that string. The list of strings that should appear in the pop-up list are configured in a second memo, which is specified between the $sl macro commands.

For example a GTD Context pop-up list could be configured with the following two memos. The first defines a GTD list of macros in the main Teikei window. The ‘@’ macro will call the Context pop-up:

TeikeiA;GTD
@;$slContext$sl
...

The Context memo then defines the entries that can be selected in the Context pop-up:

Context
@Home
@Shops
@Work

So when the user launches Teikei and clicks on the ‘@’ macro they are shown a pop-up list of the following values:

@Home
@Shops
@Work

Selecting one of these values sends it to the output.

Display Two-Level Pop-up List - $s2<popUpMemo>$s2

This command works in a similar way to $sl but allows two levels of pop-up list to be displayed. A Contacts pop-up list which displays options for separate Business and Personal lists could be configured as follows:

TeikeiA;GTD
Contacts;$s2Contacts$s2
...

The Contacts memo will define sub-lists for Business and Personal contacts:

Contacts
Business;$slBusContacts$sl
Personal;$slPerContacts$sl

Finally the BusContacts and PerContacts Memos list the actual contacts names:

BusContacts
Albert
Barney
Charles

Prompt for Phone Number - $ph<init value>$ph

This macro pops up a phone number selector defaulting to the specified number. The dialog allows for the quick entry of phone numbers using columns of numbers as pick lists - similar to a Tabulator calculator of old. If you don’t specify a number then it defaults to all dashes. The output of the dialog returns the selected number, suppressing any trailing dashes.

The checkbox in the phone number selector dialog specifies whether the dashs should be replaced by brackets. If you select -123-5551234 and check the box in the dialog, it will be output as (123)5551234. Example of initialising with a phone number:

$ph0123-555-6666$ph

Prompt for Number - $tk<init string>$tk

This macro pops up a number selector defaulting to the specified number. It is used in the same was as $ph but uses a conventional calculator-style numerical pad (not the phone layout). Characters typed are appended to the specified text. Keys include a few special characters, including dash, plus, backspace and delete.

$tkPhone No.:$tk

Prompt for Date - $di

This command displays the Palm’s standard date input dialog. When the user selects a date it is used to update Teikei’s internal date buffer. There is no output from this command. Tapping the [Cancel] button in the dialog terminates the Teikei macro completely.

Prompt for Time using Up/Down Buttons - $ti

This command displays the Palm’s standard time input dialog - where hours or a digit of the minutes is selected and up and down buttons used to adjust that number. This dialog defaults to the current time and allows the time to be set to a minute’s resolution. Tapping [OK] updates Teikei’s internal time buffer with the selected time. Tapping the [Cancel] button in the dialog terminates the Teikei macro completely. There is no output from this command.

Prompt for Time using Pick Lists - $t2

This command displays an alternative time input dialog - the hours and minutes are selected from pick lists. This is normally quicker than the standard dialog, but only gives a five minute resolution. The time defaults to 08:00. Tapping [OK] updates Teikei’s internal time buffer with the selected time. Tapping the dialog’s [Cancel] button terminates the Teikei macro completely.

Reload Date and Time - $dt

This command reloads Teikei’s internal date and time buffer from the Palm’s internal clock. The buffer is initialised with the current time when Teikei starts up, but is overwritten if the $di, $ti or $t2 commands are used. This command reinitialises the buffer to the current time and date again.

Output Clip Board Contents - $cb

This command sends the contents of the Clip Board to the output.

Date Manipulation

These macro commands are used to manipulate and output the date and time in a range of different formats.

Save the Date Buffer - $sv

This command saves Teikei’s internal date and time buffer to a backup buffer. This allows the internal date and time buffer to be used to manipulate another date before restoring its original contents - useful for processing the start and end times for an event.

Load the Date Buffer - $ld

This command loads Teikei’s internal date and time buffer from the backup buffer. Note that $ld will return a large negative value if $sv has not previously been used to save the date buffer in the current invocation of Teikei.

Decrement the Year - $y-

This command decrements the year stored in the internal date buffer by one. It also corrects the day if necessary, so that 29-Feb-2008 is changed to 28-Feb-2007.

Increment the Year - $y+

This command increments the year stored in the internal date buffer by one. It also corrects the day if necessary, so that 29-Feb-2008 is changed to 28-Feb-2009.

Decrement the Month - $m-

This command decrements the month stored in the internal date buffer by one. It also corrects the day if necessary, so that 31-Jul-2006 is changed to 30-Jun-2006.

Increment the Month - $m+

This command increments the month stored in the internal date buffer by one. It also corrects the day if necessary, so that 31-Aug-2006 is changed to 30-Sep-2006.

Decrement the Date - $d-

This command decrements the date stored in the internal date buffer by one day.

Increment the Date - $d+

This command increments the date stored in the internal date buffer by one day.

Output Year as Four Digits - $yy

This command outputs the year stored in the internal date buffer as four digits.

Output Year as Two Digits - $y2

This command outputs the year stored in the internal date buffer as two digits. Note that there is a bug in this command - years before 2000 are displayed as negative numbers (ie. 1960 is output as ‘-40’). The code appears to be subtracting 2000 from the current year, rather than extracting the last two digits.

Output Year in Japanese Era - $jj

This command outputs the year in the appropriate Japanese Era. 2006 is the 18th year of the Heisei era, so the command will output ‘18’. 1926 was the first year of the Showa era and so it will map to ‘01’. Teikei handles the Heisei, Showa, Taisho and Meiji periods.

Output Year in Japanese Era with zero suppression - $j1

This command outputs the year in the appropriate Japanese Era like $jj but suppresses any leading zero. 1989 was the first year of the Heisei era, so it is output as ‘1’.

Output Japanese Era - $g0

This command outputs the Japanese Era based on the year in the internal date buffer. The era name is output as Japanese text.

Output Japanese Era as H, S, T or M - $g1

This command outputs the Japanese Era based on the year in the internal date buffer. The era name is output as a single character (H, S, T or M) representing the Heisei, Showa, Taisho or Meiji periods. So this command will output ‘H’ for 2006 (since it is 18 Heisei) and ‘S’ for 1960 (35 Showa).

Output Month as Two Digits - $mm

This command outputs the month as two digits, adding a leading zero if needed.

Output Month as Digits with Zero Suppression - $m1

This command outputs the month as digits, suppressing the leading zero. So September is output as ‘9’ and October as ‘10’.

Output Day of Month as Two Digits - $dd

This command outputs the day of the month as two digits, adding a leading zero if needed.

Output Day of Month as Digits with Zero Suppression - $d1

This command outputs the day of the month as digits, suppressing the leading zero. So the 10th is output as ‘10’, but the previous day as ‘9’.

Output the Hour as Two Digits - $hh

This command outputs the hour as two digits, adding a leading zero if needed. The hour is presented in 24-hour format (00..23).

Output the Minutes past the Hour as Two Digits - $mi

This command outputs the minutes past the hour as two digits, adding a leading zero if needed.

Output the Day of the Week in Japanese - $w0

This command outputs the day of the week in Japanese.

Output the Day of the Week in English - $w1

This command outputs the day of the week as its first three letters in English (‘Sun’, ‘Mon’, ‘Tue’, etc.). Only the initial letter is capitalised.

Output the Day of the Week in Capitals - $w2

This command outputs the day of the week as its first three letters in English capitals (‘SUN’, ‘MON’, ‘TUE’, etc.).

Output the Day of the Week as its Initial - $w3

This command outputs the day of the week as its initial letter in English (‘S’, ‘M’, ‘T’, etc.).

Output the Week Number - $n0

This command outputs the week number within the year as two digits. The weeks are defined as being every seven days from the 1st of January. So if the date is ‘01-Jan-2006’ or ‘07-Jan-2006’ it returns ‘01’. If the date is ‘08-Jan-2006’ it will return ‘02’.

Output the Week Number with Zero Suppression - $n1

This command outputs the week number within the year with zero suppression. So if the date is ‘01-Jan-2006’ it returns ‘1’. If the date is ‘25-Dec-2006’ it will return ‘52’.

Output the Calendar Week Number within the Month - $n2

This command outputs the calendar week number within the month. The week is always assumed to start on Sunday - it does not take the ‘Week start’ Formats Preference into account. So Sunday ‘03-Sep-2006’ will return ‘2’ regardless of the settings in Preferences. Also see $n5.

Output the Calendar Week Number - $n3

This command outputs the calendar week number as two digits. The weeks are defined as starting on Sundays. So if the date is ‘01-Jan-2006’ it returns ‘01’. If the date is ‘02-Jan-2006’ it returns ‘02’, since that is the start of the second calendar week.

Output the Calendar Week Number with Zero Suppression - $n4

This command outputs the calendar week number suppressing the leading zero. The weeks are defined as starting on Sundays. So if the date is ‘01-Jan-2006’ it returns ‘1’. If the date is ‘02-Jan-2006’ it returns ‘2’, since that is the start of the second calendar week.

Output the Week Number within the Month - $n5

This command outputs the week number within the month. The week is defined as being every seven days from the beginning of the month. So Sunday ‘03-Sep-2006’ will return ‘1’. Also see $n2.

Output Year and Week in ISO 8601 format - $n6

This command outputs the last two digits of the year and the calendar week number in ISO 8601 (2000) format. So Sunday ‘20-Sep-2006’ will return ‘06w38’ (week 38 of 2006). Note that this format is not compatible with the latest version of ISO 8601 (2004) which requires a four digit date.

Control

These macro commands are used to change the way Teikei interacts with other applications.

Paste Method 0 - $p0

Specifies paste method 0. This is the default paste method and will work for most input. The command can be placed anywhere in a macro definition but is normally not needed to be listed explicitly.

Paste Method 1 - $p1

This command specifies paste method 1. Method 0 will not work properly in some dialogs. For example it corrupts the screen if used in the new category dialog. Specifying $p1 solves this problem, for example:

cat;Actions$p1

Paste Method 2 - $p2

This command specifies paste method 2 which should be used with CrsMemo. This is a Japanese language Memo/Note Pad replacement which you won’t find on PalmGear or Handango.

Start another DA - $da<creatorID>$da

This command starts the DA with the specified creator ID. The Teikei macro pauses until the second DA exits. For example to run ClipDA and then write the contents of the clipboard to the output:

Clip;$daCrDA$da$cb

Unverified

It has not been possible to verify how the following command works. Any information on how to use these commands would be gratefully received.

Update Time from Clipboard? - $gt

This command appears to be intended to update Teikei’s internal time buffer from a value in the clipboard. However I was unable to get it to work on a Tungsten E. It clears the clipboard, but appeared to have no other effect.