Understanding Tactor

Tactor includes handy debug mode which shows what is going on under the hood.

screen-shot56084

Input

The text usually comes from the foremost application or the clipboard.

Context Variables

First, Tactor gathers information about the ‘context‘ selection comes from. This may include the current directory or window’s title and is used by the Matcher plugins to guess the best possible match.

The Matcher plugins are stored in ~/Library/Application Support/Tactor/Plugins

Tactor is able to extract ‘context’ from most document based applications. Additional applications and/or context variables may be added by implementing new AppleScript plugins. The plugins are conceptually very similar to ones used by the ActoTracker or the TagoMan.

The ‘Context’ plugins provides as part of the Tactor itself (in the app’s Content/PlugIns folder), however you can overrider or add new plugins by placing them in ~/Library/Application Support/Tactor/Plugins

Matching Context to Actions

A Matcher plugin is responsible for matching context variables to action variables.

In our example, the CTX_TEXT contains output of the ‘ls’ command and Terminal’s current path stored in the CTX_DIR. The builtin file matcher script will extract file names using regexp out of the text, prepend the current path and store the resulting new-line delimited file list as ACT_PATHS variable.

Action Variables

An Action plugin will look for ACT_ variables it understands and offer corresponding ‘actions’ to the user. For example, ACT_PATH will result in actions Open and Reveal being shown.

The  plugin will also take care of actually carrying the action out if user selects it from the menu.