D&Do v. 1.0 Prev Next Top
Subdirectory Creator Example
Note: To execute this example, you need a commercial license since the tagged drop feature is not available in the freeware version. However, the freeware version will associate a drop with a tag but it will not execute the program.
This sub-section illustrates the "efficient way" of creating many subdirectories from text fragment taken from viewed Web pages; it corresponds to Example 1 of the Introduction. It assumes that you already have started D&Do, that you know how to load a metascript and that you know how to highlight text, to use the clipboard and to drag and drop desktop objects.
- Open the DCreator.ms file. D&Do target area changes its color as illustrated below:

Note: The cyan color means that D&Do will associate some drops with tags and it hints to what it expects for the next drop object. Each tagged drop has a unique role in the argument list of the program. The message on this area displays an action hint (BY1) and a tag name (ID= Dest Dir). This action hint tells us that D&Do will be activated from a click on the target area and once started, a command will be executed for each untagged drop, one by one. The tag name hints to us that D&Do expects a "destination" directory for its next drop. Take note that the above screenshot is on a registered version of D&Do.
- Select a Web page that contains the text fragment that you want to use as directory names
- Using your Windows Explorer (in Windows), select the directory that will contain the subdirectories (e.g. F:\myData\Tests)
- Drag the directory symbol into the cyan target area. Observe that the target area message is changed into "Text drops". Observe also that the status line displays the content of the last drop item, its order in the list (now, "0") and the drop type (here, DIR for directory).
- Highlight a text fragment from the Web page
- Drag the highlighted text then drop it into the target area of D&Do. Observe that the drop order in the list is now "1", and that the drop is of text type (TXT). At any time, you can have a peek at the whole list of drops, on the tool-tip display of the status line.
- Repeat the above last two steps for other text fragments.
- Once your have entered your list of text fragments, click the target area. You should see the following:
- The target area displays "WAIT" while D&Do is working
- A short "Done" message had flashed on the target area which tells you that it has completed the job, then the initial message (BY1 ID= Dest Dir) is displayed again.
- The creation of as many subdirectories as you have dropped text-type drops
- That the subdirectory name is a slightly modified version of the text fragment (it complies to specific conventions, for example)
- The status line display "INF: Exit = 0", which means that everything is OK.
D&Do is now ready to accept another target directory followed by other text fragments. D&Do had simply eased the program usage for you; it is the program itself that has created the subdirectories. Note: The program is a Python script, its source file name is DCreator.py and it is located in the scripts/py sub-directory.
Try the program from the command line and see how many typing and clicking you have to do. Try also to create directories manually directly from the Windows Explorer and see how inconvenient it is if you want to create tens of subdirectories.
Let us experiment a little more.
- Delete the created subdirectories.
- While the D&Do has the desktop focus, press the [2] key; you should see "D&Do: FDcreator 2-Underscore". The "2-Underscore" identifies a different variant of the argument list template.
- Redo the previous operation for creating subdirectories.
The results are the same except that the subdirectory names are slightly different -- spaces in each text fragment are replaced by underscores. This is because you are using the underlying program differently. You can display the documentation about the DCreator metascript, just click the "Help" menu item of the popup menu.
That gives a good idea on how D&Do is used and on some of its possibilities. If the metascript and program files are provided by someone else, you may skip the Metascript Exploration section. For those who want to build metascripts, read on.
Note for Linux users using the Gnome desktop environment: The Gnome Nautilus is the Linux equivalent of the Windows Explorer.
Example Conclusions
We learned how to:
- "Read" the D&Do GUI
- Select metascript variants
We experience the following concepts:
- Behavior (see also below)
- Tag (tagged drops and untagged drops)
- Variant
About the D&Do behavior
D&Do can express different behaviors. There are indeed nine (9) basic types of behaviors; they are summarized in the section Target Area. In this example, we have explored the behavior number 7 (TDrops Do 1by1). The previous example illustrated the behavior number 2 (Drop Express).
Prev Next Top
Copyright(c) 2003-2004 Marcel St-Amant