D&Do v. 1.0   Prev   Next   Top


Default Command line Template

The D&Do job is to create the proper system command line from a command template then execute it. The command template starts with a program block followed by an argument block (see Command Line). D&Do reads the program block as it is but it processes the string expression contained in the argument block. Reserved character pairs (known as template variables) that are found in the latter block are replaced by their associated value, each time that string expression is processed. Here are the default reserved character pairs:

Here are the two main metascript parameters:

Most of the times, a script file is used with a script executor. Under that circumstance, the EXEC parameter will contain the script executor (e.g. CScript, pythonw, java, qbasic, php, etc) The ARG parameter will contain the script file name followed by its argument list. A Python example would be:
EXEC:pythonw
ARG: script/py/FNamer.py "*0" *# -C

Important Note: You may specify the path name of a file either as an absolute name from the system root or as a relative name from the D&Do home directory. This is why the python script FNamer.py is preceded by script\py directory path. If the path environment variable contains the path to the directory of a script or of an executable, then the file name is sufficient; this is the case of pythonw (the Python script executor in most Python installations) that is found for the EXEC parameter..

TIP: Using a metascript with an empty EXEC parameter provides a way to view its resolved argument list with the help of a clipboard viewer. This feature is helpful for debugging metascript files.

By default, the argument list template variables are **, *# and *0 to *9. There might be rare circumstances where some of these 2-characters combinations can be found elsewhere within the argument list template but should not be interpreted. These template variable names can be redefined as follows:

Note: Most examples of argument list template are shown with well-separated template variables. It is not required that such variables be separated by spaces; it can even be embedded within words. This is why such variables should contain uncommon characters. Here are two valid expression segments:
-d*2/hex (third tagged drop between -d and /hex)
***0hex (The template variables representing the clipboard and first tagged drop are stuck together)

 Important note about the freeware version

The argument list template can have multiple instances of the same variable. The commercial version of D&Do will interpret them as expected. The freeware version, however, will only process the first instance of each template variable; this is an imposed limitation to the non-registered D&Do application. The following example illustrates the difference (the *# variable has two instances):

EXEC: del
ARG: *#\*.bak *#\*.tmp

Where, the untagged drop contains the directory: c:\myFiles

The freeware version and the commercial version will generate the command respectively as follows:
Commercial version: del c:\myFiles\*.bak c:\myFiles\*.tmp
Freeware version: del c:\myFiles\*.bak *#\*.tmp

 


Prev   Next   Top

Copyright(c) 2003-2004 Marcel St-Amant