How to write ObexTool-Plugins

Any action regarding a file depends on the corresponding file type. The file type is identified by the case-insensitive file name extension (that part of the file name which follows the last period).

To write a ObexTool plugin for a specific file type, you have to follow the tasks described below:

Write a tcl/tk program which includes a root-namespace which is named identical to the intended file extension in upper case.
At least one function called default_handler MUST exist in that namespace and MUST have args as vararg-parameter

Example: if the extension is ".vcs" (VCal organizer entry on M50), create the following plugin code:

namespace eval ::VCS {

variable ... ... proc default_handler { args } {

...

}

The function is called with the following 6 parameters:

Full path name of the file or folder

File type (lowercase extension without '.' or "folder")

Size (or empty, if it is a folder)

File date (last modified date)

User permissions (example "RWD")

Group permissions (example "W")

Name the file identical to the file extension in lowercase, appended by an underscore and any additional naming.

Example - assuming the same file type as mentionend in the example above:

vcs_plugin.tcl

Plugins MUST be located in the plugins directory of the ObexTool and will be sourced on demand, i.e. when a file of the corresponding extension is being double-clicked or the context menu "Plugin" is activated over a plugin sensitive file.

If a single plugin consists of several source files, the files will be read in alphabetical order. Therefore name your source files according to the intended load order.