Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at: https://www.gnu.org/copyleft/fdl.html.
Table 2-I Executor Operands
Table 3-I Executor Default Menus
Figure 2-1 STF File Associations Menu
In reading this document, Familiarity with the STF Syntax Summary is assumed. (Download document PDF)
One of the tools imported from Nuances In Computing (NIC) is Executor.py, or just Executor. Executor makes it easy to attach a GUI(1) menu to any file extension. Once the GUI has been attached to an extension(2), doubleclicking the extension causes Executor to display a menu of commands to be invoked. This approach can make it easier to implement a process, such as document preparation. See Figure 2-1 for the file associations menu for extension STF.
This discussion is Windows centric, however the commands are also supported by UNIX/Linux.
The first time Executor is invoked, it copies its default menus to C:\Users\'Owner'\.nic\Executor, where owner is your login name. The default menu is shown in Table Tab-3-I. The commands specified in the table must be on the current path(3); or be a fully qualified path enclosed in quotation marks. Commands are invoked using Windows batch processor, cmd.exe, which comes with Windows, unless the command is preceded with "(PS)", in which case it is invoked using the power shell(4), which also comes with windows. The operands, shown in table Tab-2-I, may be intermixed with constant text to define the command that is to operate on files of the specified extension. Feel free to customize the Executor menu as desired.
Operand |
Meaning |
Example |
|---|---|---|
%p |
Full path to the file |
c:\dir\file.ext |
%d |
Drive |
c: |
%r |
Root |
\dir\ |
%f |
File name |
file |
%e |
File extension |
ext |
%[prompt] |
Prompt for keyboard input |
input replaces operand |
Using the operands the full path to a file is: %p = %d%r%f.%e = c:\root\filename.ext

The Executor's default menu references commands supported in NIC. Not all of these commands are installed by default by the STF installer. The "NIC" column indicates if the command is installed along with NIC, the "STF" column indicates if the command is installed along with STF. Commands not included in STF may be self installed.
Ext |
Command |
Operand |
Comments |
NIC |
STF |
|---|---|---|---|---|---|
TXT | |||||
txt |
(PS)Wordpad |
"%p" |
Editor |
N |
N |
txt |
(PS)Notepad |
"%p |
Editor |
N |
N |
txt |
(PS)xemacs |
"%p" |
Editor |
N |
N |
txt |
(PS)filemgr |
"%p" |
File Manager |
Y |
N |
txt |
(PS)NewSTF |
"%f" |
Creates a sample STF input file |
Y |
Y |
STI | |||||
sti |
(PS)Wordpad |
"%p" |
Editor |
N |
N |
sti |
(PS)Notepad |
"%p" |
Editor |
N |
N |
sti |
(PS)xemacs |
"%p" |
Editor |
N |
N |
sti |
(PS)filemgr |
"%p" |
File Manager |
Y |
N |
sti |
(PS)ViewSubDoc |
"%p" |
Formats an include file for viewing |
Y |
Y |
sti |
(PS)SuperCleanSTF |
|
Removes all the junk files |
Y |
Y |
sti |
(PS)SuperCleanLatex |
|
Removes all the junk files, except for .tex |
Y |
Y |
sti |
(PS)NewSTF |
"%f" |
Creates a model STF file |
Y |
Y |
STF | |||||
stf |
(PS)Wordpad |
"%f.%e" |
Editor |
N |
N |
stf |
(PS)makeDoc |
"%f" |
Formats an STF file without a contents |
Y |
Y |
stf |
(PS)makeDocWithIndex |
"%f" |
Formats file with a contents and index |
Y |
Y |
stf |
(PS)makeRTFDoc |
"%f" |
Formats an STF file to RTF format |
Y |
Y |
stf |
(PS)makeWiki |
"%f" |
Formats an STF file to Wiki format |
Y |
Y |
stf |
(PS)ViewSubDoc |
"%p" |
Formats an include file for viewing |
Y |
Y |
stf |
(PS)SuperCleanSTF |
|
Removes all the junk files |
Y |
Y |
stf |
(PS)SuperCleanLatex |
|
Removes all the junk files, except for .tex |
Y |
Y |
stf |
(PS)NewSTF |
"%f" |
Creates a sample STF input file |
Y |
Y |
stf |
(PS)xemacs |
"%p" |
Editor |
N |
N |
(PS)AcroRd32 |
"%p" |
Views file using Acrord32 |
N |
N |
|
(PS)PdfDrvr |
"%p" |
Manipulates PDF files |
Y |
N |
|
DAT | |||||
dat |
(PS)xemacs |
"%p" |
Editor |
N |
N |
During the STF installation process(5), Executor is copied to C:\Users\Public\Cmds. Executor is invoked from batch file ExecutorDrvr.bat also located in C:\Users\Public\Cmds.
The format of the Executor initialization file is:
Extension *- command *- operands
The initialization file is named: C:\Users\"owner"\.nic\Executor\Executor.ini, where "owner" is your login name.
C:\Users\Public\Cmds\ExecutorDrvr.bat must be associated with each file extension specified in Executor.ini in order for a menu to be displayed when a file of that extension is doubleclicked. The process of associating ExecutorDrvr with file extensions is discussed under installation in the STF Syntax Summary.
To execute an Executor command on a file, doubleclick on a file with a defined extension. The menu corresponding to that extension will be displayed. (See Figure 2-1 for the STF extension menu.) Then doubleclick the menu entry and the command will operate as specified in Executor.ini.
It requires knowledge of UNIX/Linux(6) internals to associate an extension with an arbitrary program. Fortuntely there is an easier way to implement a GUI. This involves installing the GNOME desktop and using the GNOME filemanager, Nautilus. Nautilus supports add-on shell scripts. Nautilus scripts are placed in directory $HOME/.local/share/nautilus/scripts and are invoked by right-clicking on a file name in Nautilus.
STF provides a collection of Nautilus shell scripts to implement the GUI menu shown in figure 2-1. It also provides a single script, named 1Menu, to invoke Executor to present the same menus as Windows. The difference between right-clicking and selecting 1Menu and selecting the explicit STF script is Executor only presents the commands tied to an explicit extension, where as Nautilus shows all scripts in the command directory. Other than that, the two approaches provide the same functionality, because they use the same scripts. For more information on UNIX installation see the installation section in the STF Syntax Summary.
(2) Built-in extensions, such as exe and bat are excluded.
(3) Discussed in the STF Syntax Summary
(4) Windows has recently reduced support for cmd.exe, so the Power Shell is recommended