Jaap's Psion II Page

Help for OPK file editor


1. Quick tour 1.1 Controls 1.2 Editor/Viewers

2. Detailed help 2.1 OPK files 2.2 Getting started 2.3 Pack Contents list 2.4 Adding new items 2.5 Editing items 2.6 Saving

3. Download


1. Quick tour

This is a manual for the OPK File Editor. For an explanation of what the Psion Organiser II OPK files are, see below for the more detailed help.

1.1 Controls

Here is quick tour of the various controls of the OPK file editor.

Pack contentsList of contents of the currently loaded pack. Click an item to edit/view it. Items can be dragged to change the order.
Item contentsViewer/editor for the currently selected item on the pack.
New PackStart with a new empty pack image.
Load PackOpen an existing OPK file from your computer.
Save Pack AsSave the current pack to an OPK file. This is only possible if there are no pending edits.
Add New ItemAdd a new empty file or record to the pack.
Import ItemAdd a new item to the pack by importing it from a file on your computer. The file can be a Psion binary file (e.g. .OB3 file), a data file (.ODB file), a source code file (.OPL), or a notepad text file (.NTS).
DiscardDiscard any changes you may have made to the currently selected pack item.
ApplyAccept any changes you may have made to the currently selected pack item, thereby updating the pack.
Erase ItemRemove the currently selected pack item from the pack completely.
Export ItemSave the currently selected pack item to a file. A data file will be exported to an .ODB file, and all other file types to a binary file (e.g. procedure to .OB3 files). Individual file records cannot be saved, nor can procedure source code or notepad files be saved directly as text files.

1.2 Editor/Viewers

Here is quick overview of the various things that can be present in a pack, and how to edit/view them.

HeaderSet/unset copy/write protection by clicking the check boxes. Most other parts of the pack header can be edited, but are best left as is unless you know what you are doing. Pack size will be increased automatically if necessary.
Data fileThe name and file Id can be changed. If you change the file Id, all its records will be updated too. If the file is marked as deleted, all its records are marked deleted too.
File recordCan be marked as deleted. Contents can be edited. If empty, a space will be added; if too long it will be truncated.
ProcedureCan be renamed or marked as deleted. Source code can be edited. Object code will not be updated to reflect the changed source code.
NotepadCan be renamed or marked as deleted. Contents can be edited. Encrypted notepads can only be edited once the correct password has been entered. Decrypted notepads become unencrypted if the entered password is deleted. Unencrypted notepads become encrypted if a password is entered.
Data blockHeaderless data block, possibly containing boot code. Viewer only shows the size of the content.
Other binary filesCan be renamed or marked as deleted. Contents cannot be edited, and only the size of the content is displayed.

2. Detailed help

2.1. OPK files

An OPK file is an image of a Psion Organiser II memory pack (Datapak, Rampak, or Flashpak), so it is a computer file that holds an exact copy of the pack's contents. If you have a Psion II and a Comms Link connected to a PC, then you can copy the contents of any Psion pack to the PC. There are three tools available for this:

My preferred option is the last, DumpPack.

A complete description of the internal structure of an OPK file is found on the Psion File Formats page. Such in depth knowledge is not needed when using the OPK File Editor, but I'll summarise the necessary basics below.

A Psion pack can contain various types of file, but the most common are data files, the data file records, and procedures.

2.2 Getting started

To start with a fresh blank pack image, click the New Pack button. This gives you a pack image that is identical to an 8K pack that has just been sized in the Organiser.
To start editing an existing OPK file, click the Load Pack button. You then get a dialog that allows you to select the OPK file from your computer's file system. The selected file is then loaded, and its contents shown on the web page.

2.3 Pack Contents list

The left of the screen shows the list of contents of the pack. Each data file, file record, procedure, etc., takes up one line on this list. When you click almost any item on the list, an editor/viewer will appear on the right hand side of the page. This allows you to view, and even edit the selected file or record.

You can also click and drag almost any item on the list if you want to change their order. The first and last items on the list cannot be moved however. The first item is the pack header, and it contains information about the size and type of pack as well as the copy and write protection. The last entry on the list is called End of Pack and does not correspond to any file but merely marks the start of the free space on the pack. The second item on the pack is normally the MAIN data file, and moving it to a different location on the pack is not recommended, as it is not guaranteed that every Organiser II is able to handle that correctly.

2.4 Adding new items

Adding new items to the pack can be done in two ways.

  1. If you click the Add New Item button, you will get a pop-up to ask what kind of item you want to add, after which a blank item of that type will be added to the end of the pack. You will then probably have to edit the file name or contents (see below) and maybe move it to where you want it to be located on the pack contents list.
  2. If you click the Import Item button, you can select a file from your computer, which can be a Psion binary file (e.g. a .OB3 file), an .OPL file containing procedure source code, a data file with extension .ODB, or a notepad text file with extension .NTS. The contents of the file will be loaded and placed as a new file at the end of the pack. You can then edit the file name or contents (see below) and move it to where you want it to be located on the pack contents list.

2.5 Editing items

Click an item on the contents list to select it. Its contents will be shown in an editor/viewer on the right hand side of the page (though you may have to scroll up first if the pack contents list is long and you are down the bottom). You may be able to edit the item, for example by clicking a checkbox that marks it as deleted, or by changing the file name. Once edited, you can either discard the changes by clicking the Discard button above the editor, or apply the changes to the pack by clicking the Apply button.

The various types of item and their editor/viewers are listed in the table below:

Header The pack header contains settings and information about the pack. For full details, see the Psion File Formats page. You can set or unset the copy/write protection by clicking the check boxes, or change the pack to a Rampak by unsetting the EPROM box. Most other parts of the pack header can be edited, but are best left as is unless you know what you are doing. Pack size will be increased automatically if necessary.
Data file The name of the file and the file Id can be changed. If you change the file Id, and then apply that change to the pack, all its records will be updated too, included records that are marked as deleted. If the file itself is marked as deleted or undeleted by changing the checkbox, all its records are marked deleted or undeleted too when the edits are applied to the pack.
File record A record can be marked as deleted or undeleted. Contents can be edited. Note that a record cannot be empty, so a space will be added if necessary. If you make a record too long it will be truncated to 254 characters.
Procedure Procedures can be renamed or marked as deleted. The source code can be edited, but be aware that the object code will not be updated to reflect the changed source code, as the editor cannot translate the OPL source.
Notepad Notepad files can be renamed or marked as deleted, and their contents can be edited. You can change whether the notepad lines are numbered, but the line numbering is not displayed in the editor. Encrypted notepads can only be edited once the correct password has been entered. Decrypted notepads become unencrypted if the entered password is deleted. Unencrypted notepads become encrypted if a password is entered.
Data block This is a headerless data block, possibly containing boot code, i.e. code that is loaded and run when ON/CLEAR is pressed on the Organiser main menu. This cannot be edited, and only the size of the content is shown.
Other binary files These files could be Comms Link setup files, CM/XP diary files, spreadsheet files, or some user-defined type of file. The file can be renamed or marked as deleted, but its contents cannot be edited. Only the size of the file content is displayed.

2.6 Saving

The OPK file can be saved to your computer by clicking the Save Pack As button. Note that the button is not available if there are pending edits that still have to be applied or discarded.

Most pack items can also be saved to file separately by pressing the Export Item button. Exporting a data file results in an .ODB file containing all the records for the file that have not been marked as deleted. Exporting a procedure results in an .OB3 binary file, and exporting other files will similarly result in a binary file with the file extension .OBx where x is the file type. Exporting procedure source code to an OPL file or notepad text to a NTS file is not supported. File records, the pack header, and headerless data blocks cannot be exported.


3. Download

If you wish to use this OPK editor offline, then you can download it. Download and save opkedit.zip, and then unpack the contents of the zip file to a folder on your computer. To use the editor, open the file called opkedit.htm.