D&Do v. 1.0 Prev Next Top
D&Do does nothing by itself; the real work is done by the command line that is specified through a template expression in a metascript file. Before being able to do any useful work, D&Do must have loaded a proper metascript file.
A metascript is a text-based file that contains, among other things:
- The name of the executable file (e.g. the program)
- Its argument list template where some of its elements are template variables that identify their source. Each such variable identifies either one of the tagged drops, the collection of untagged drops or the clipboard. Note: A metascript may contain up to 11 variants of such templates but only one is active at the time of the execution.
- A configuration of the D&Do behavior
- Optionally, a list of tags
- Optionally, a map of error messages to error codes
Usually, D&Do operates internally in the following sequence:
- Based from the loaded metascript, D&Do accepts dropped text, files and directories and keeps them into its local drop list. D&Do acknowledges each drop it receives. You can always see the content of the drop list as a tool-tip message.
- When a proper trigger is received (either from a click on the target area, or from the drop objets that is associated with the last tag, or from any accepted drop):
- The active variant of the argument list templates is interpreted, replacing each template variable for the content of the related drop, untagged drop list, or the content of the clipboard. In many cases, a template variable corresponds to an argument of the program.
- It will execute the program with the resolved argument list
- It waits for the termination of the program execution. Otherwise, it times out.
- It repeats the three previous steps if the metascript specifies to use one untagged item of the drop list at a time
- It alerts you that the program activity is terminated (by flashing a "DONE" message on its target area). If the program has generated an error, D&Do will alert you of such an occurrence by flashing a yellow color on its target area.
- If instructed so, the normal outputs of the program may be written into the clipboard
- The system exit code of the program is processed as a message to be displayed on its status line and on its tool-tip.
At that point, D&Do has done its job. You may also want to paste the clipboard content into a specific point of your application. Note: The program itself might do other inputs and outputs such as, for example, reading and writing files, playing sounds, accessing the network, etc. This aspect is however the domain of that specific program and is out of the context of this document.
Prev Next Top
Copyright (c) 2003 Marcel St-Amant