| language
Information, tips and tutorials for ZTree file manager
s_ScriptsStandards
Scripts writing and sharing standards
A first draft of how to standardize scripts has been written some time ago by Slobodan Vujnonic on his ZEN website.
The following is a second draft of ideas.
Both should be subject of intense discussions with the community on how we should document, standardize scripts and distribute to users. The new ZAM format helps by giving more granuality to the process of sharing scripts, but it does not solve the problem completely.
Assumptions
- If you use external utilities, your script should be written location-independent. Always assume executables ARE in the path, EVEN though the most common error for non-execution of scripts is precisely that executables are not in the path. Careful users will check that this does not happen, or will use a batch file or launching utility like the ZTree Launcher, to set the path correctly. By writing location-independent scripts, you increase portability.
Documentation headers
- Use :: to comment rather than REM for a cleaner appearance.
- The ideal complete header for any script is the following:
NOTE: As of version 1.60rc19, when ZTreeWin exports (Writes) F9 scripts it adds the item description as a comment on the 1st line. When it imports (Loads) a script, if the first line is a comment it uses it as the item description. A change in script presentation standard has been required to reflect this change. The first line is now the item description starting with double colons ::
::Name of script :: Purpose: (what it does) :: Author: (your name) :: Original author: (if you modified an existing script of somebody else) :: Contributors: (if more than one contributed) :: Version: (use date and version numbering, such as "2007-12-07, v0.92" :: ZTW ver: (version number of ZTree under which the script works) :: OS version: (Windows version under which the script was developped) :: Requires: (specific version of Windows or external utility) :: Source: (web address to download the utility if it applies) :: Usage: (non-obvious instructions or behavior) :: Note: (if any) :: History: (keep tracks of any changes worth mentionning) [Code]
Example:
::Explore branch :: Purpose: Open a Windows Explorer window at current branch :: Author: Laurent Duchastel :: Original author: Michael Kahn :: Contributors: Kim Henkel, Ian Binnie, Slobodan Vujnovic :: Version: 2007-12-07, v1.01 :: ZTW ver: 1.51.12 :: OS version: WinXP Pro SP2 FR :: Requires: n/a :: Source: n/a :: Usage: na/ :: Note: Shift-F10 on current branch works also :: History: n/a start "" explorer.exe /select,%7
Contributors to this page: JohnG
,
laurent
and
admin
.
Page last modified on Saturday 04 of August, 2007 18:52:46 EDT by JohnG.
