DirCreateWS
DirCreate helps a desktop user in creating many valid sub-directories using text segments from documents. It avoids the requirement of editing manually directory names in order to be compliant with the operating system and user policy.
Description
Overview
DirCreate accepts a directory drop followed by untagged text drops. Upon activation, DirCreate will modify each dropped text into related valid directory name(s). The next action depends on the selected variant (see the Variants sub-section below).
A dropped text is modified as follows:
- Leading and trailing whitespace characters (space, tab, linefeed, carriage return) are removed
- The remaining whitespace characters are replaced by the hyphen character
- The following characters are replaced by an underscore character: $%&',?!><\/*{}()[]"
Variants
- Default:
Create a sub-directory with a named that comes from the modified text under a directory that corresponds to the directory drop.
- 1-To_Clipbrd:
Output the modified text into the system clipboard. Note: This variant makes sense only when using one untagged drop. The directory drop has no effect. You can use the clipboard content for creating the properly named sub-directory anywhere in your system.
- 2-VBS, Dir Create:
Create a sub-directory with a named that comes from the modified text under a directory that corresponds to the directory drop.
- 3-VBS, To_Clipbrd:
Output the modified text into the system clipboard. Note: This variant makes sense only when using one untagged drop. The directory drop has no effect. You can use the clipboard content for creating the properly named sub-directory anywhere in your system.
Note: The second and forth variants should not be part with the first variant under the same metascript; this is a poor design. The purpose of this metascript is purely educational only. Both, the metascripts and the scripts have been kept as simple as possible.
Tagged Drops
There is one tagged drop: the "destination" directory drop (identified as "A Dir")
Untagged Drops
The untagged text drops are identified as "Text drops". Each text drop will be modified, as necessary, for generating a valid directory name.
Clipboard Use
The clipboard is not used as input for any variant. However, for the variant "To_Clipbrd", the clipboard will contains the modified text of the last text drop.
Possible Metascript-Related Messages
Script-generated error messages. Here are the possibilities:
- ERR: Nb Args, 2 or 3
The underlying script expects 2 or 3 arguments. This error should never occur.
- ERR: Dir not exist
The destination directory does not exist. This directory might have been deleted (or disconnected) since the time you made the directory drop.
- ERR: -P or -C only
The underlying script expects -C (for default variant) or -P (for To_Clipbrd variant) and nothing else. This occur may occur if you create other variants with invalid argument sets, otherwise it should never occur.
- ERR: Unable to create
The sub-directory cannot be created. May be, you do not have writing privilege at the destination directory. For some script language used by the underlying script, it may be due to an attempt of creating a sub-directory with the same name of another existing sub-directory at the same location.
Other Considerations
An explicit Clear List command is required if an error is encountered. Otherwise, the list of drops is automatically cleared upon a successful operation.
Script Effects
For the default variant, DirCreate will create sub-directories.
Requirements
The requirements for DirCreatePy version of DirCreate.
- Executable:
cscript /nologo (the Windows scripting; terminal version)
- Script file(s):
tutorial\DirCreate.js, for variants 1 and default. tutorial\DirCreate.vbs, for variants 2 and 3.
- IO access:
Directory creation
Side Effects:
- Clipboard Usage:
Yes, as output
- No other side effect.
Instructions
See also the Purpose section above.
Tasks:
- Creating sub-directories
- Creating a sub-directory name
Creating sub-directories
Here are the detailed instructions for creating sub-directories with names based from displayed documents.
- Make sure that D&Do title bar display: D&Do: DirCreateWS and nothing else (the default variant is selected) or that the 2-VBS, Dir Create one is selected.
- Make sure that D&Do cyan drop target area displays: BY1 ID= A Dir
- Using a file browser (ex. the Windows Explorer):
- Make the destination directory visible (expanding directories as necessary)
- Press the mouse button when the cursor is on the destination directory, drag the cursor to the D&Do target area then release the button.
- Using any document browser that accepts text drag (ex. the Internet Explorer, the MS Word, HTML Help viewer, many dialog messages, etc)
- For every sub-directory to create
- Make sure that D&Do cyan drop target area displays: Text drops
- Select a text fragment that you want to use as sub-directory name (using a text highlighting drag movement)
- Release the mouse; the selected text should be highlighted
- Press the mouse button when the cursor is on the highlighted text, drag the cursor to the D&Do target area then release the button
- Click the drop target area
- You should observe that:
- New sub-directories have been created under the destination directory
- The drop target should display: BY1 ID= A Dir
- The status message display: INF: Exit = 0
This is it.
Creating a sub-directory name
Here are the detailed instructions for creating a valid name for a sub-directory into your system clipboard.
- Make sure that D&Do title bar display: D&Do: DirCreate 1-ToClipbrd; (or 3-BSF, To_Clipbrd) the variant 1 or 3 is selected.
- Make sure that D&Do cyan drop target area displays: BY1 ID= A Dir
- From a file browser (ex. the Windows Explorer), with the mouse, click any directory, drag it into the D&Do drop target
- Using any document browser that accepts text drag (ex. the Internet Explorer, the MS Word, HTML Help viewer, many dialog messages, etc)
- Make sure that D&Do cyan drop target area displays: Text drops
- Select a text fragment that you want to use as sub-directory name (using a text highlighting drag movement)
- Release the mouse; the selected text should be highlighted
- Click on the highlighted text, drag it to the D&Do drop target
- Click the drop target area
- You should observe that:
- The drop target should display: BY1 ID= A Dir
- The status message display: INF: Exit = 0
- You can use the system clipboard content for creating manually a sub-directory or for any other purpose.
This is it.
Source
Please, add authors and owners for each version of the matascript
Owner(s):
- Company:
Big Feet Software
- License:
Freeware; you may use and modify this metascript and related script files. You cannot claim ownership of their original version.
Author(s):
- Name:
Marcel St-Amant
- Country:
CANADA
- Release Date:
2003-10-13
- Version:
1.0