DirCreatePy1
DirCreatePy1 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
DirCreatePy1 accepts untagged text drops. Upon activation, DirCreatePy1 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 whose path is contained in the clipboard.
- 1-To_Clipbrd:
Output the modified text into the system clipboard.
Tagged Drops
There is no tagged drop.
Untagged Drops
The text drop will be modified, as necessary, for generating a valid directory name.
Clipboard Use
The clipboard is used as input for the default variant; the path to the destination directory is expected to be found there. For the variant "To_Clipbrd", the clipboard will contains the modified text from the 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 error 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 DirCreate1Py version of DirCreate.
- Executable:
pythonw
- Script file(s):
tutorial\DirCreate.py, by all variants.
- IO access:
Directory creation
Side Effects:
- Clipboard Usage:
Yes, as output
- No other side effect.
Instructions
See also the Purpose section above.
Tasks:
- Creating a sub-directory
- 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: DirCreate1Py and nothing else (the default variant is selected)
- Make sure that D&Do green drop target area displays nothing
- Using a file browser (ex. the Windows Explorer):
- Make the destination directory visible (expanding directories as necessary)
- Select that directory
- Do a Ctrl-V; this will copy the directory path to the system clipboard.
- Using any document browser that accepts text drag (ex. the Internet Explorer, the MS Word, HTML Help viewer, many dialog messages, etc)
- Highlight a text fragment that you want to use as sub-directory name
- 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
- You should observe that:
- A new sub-directories have been created under the destination directory
- The drop target should display nothing
- 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: DirCreate1Py 1-ToClipbrd; the variant 1 is selected.
- Make sure that D&Do cyan drop target area displays nothing
- 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
- Highlight 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
- 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