Code: Select all
v9.30.0023 - 2010-07-29 12:14
+ Scripting got a new function.
Name: listfolder
Action: Lists the contents of a folder (non-recursive).
Syntax: listfolder([path=<curpath>], [pattern=*], [filesonly], _
[separator="|"])
path: Path of folder to list; defaults to current list path.
Special paths ("Desktop") and portable paths ("?:\")
are supported.
pattern: Wildcard (?, *) pattern to filter returned items;
defaults to "*" (show all).
If no wildcards are contained, the pattern is auto-
embraced by "*".
filesonly:
0: show folders and files [default]
1: show only filees
separator: Separates the items in the returned list;
defaults to | (pipe).
return: List of items.
Notes:
- The order of items is determined by the OS resp. file system.
For XP/NTFS and later it's alphabetical, files and folders
mixed.
- The possibilities this command brings to scripting are mind-
boggling.
Examples:
//list all items current list folder
::text listfolder();
//list all items in %windir% that contain "y" in the name
::text listfolder(%windir%, "y", , <crlf>);
//list all DLL files in %windir% (typically C:\Windows\)
//and gives a short report on them
::$itemlist = listfolder(%windir%, "*.dll", 1);
text report("{Name}, {Size B} bytes,
{Modified yyyy-mm-dd hh:nn:ss},
ver {FileVersion}<crlf>", $itemlist);
//list all DLL files in %windir%, select one to goto
::$itemlist = listfolder(%windir%, "*.dll", 1);
goto inputselect("DLLs in %windir%", $itemlist, , 1);
+ Scripting got a new function.
Name: replacelist
Action: Replaces substrings by list.
Syntax: replacelist(string, searchlist, [replacelist], _
[delimiter], [matchcase])
string: String to work on (haystack).
searchlist: Substrings to be replaced (needles).
replacelist: Substrings to replace with.
empty: All substrings in searchlist are removed.
delimiter: Delimites the strings in the lists;
empty: Each character is taken as a substring.
matchcase: Compare method.
0: A=a [Default]
1: A<>a
return: The new string.
Examples:
::text replacelist("Taxi", "ai", "ia"); //Tixa
::text replacelist("Taxi", "ax,i", "-,Rex", ","); //T-Rex
::text replacelist("Taxi", "ai"); //Tx
Notes:
- As you see from the 2nd example, the strings in search-replace
pair can have different lengths.
- If the item count in both list differs, then the smaller count
is used and the surplus items are ignored.
- The string is walked on time from left to right; any replaced
parts are not processed again. So in this example, "Rex" will
not be replaced by "Bone" in a second pass:
::text replacelist("Taxi", "ax,i,Rex", "-,Rex,Bone", ",");
- The substrings are processed from left to right, first match
wins. Therefore:
::text replacelist("Taxi", "a,ax", "i,ox"); //Tixi
::text replacelist("Taxi", "ax,a", "ox,i"); //Toxi
Usage:
- This command can be used for interesting things, e.g. to
(roughly) transliterate e.g. Cyrillic to Latin, or do some
simple encryption, or clean file names from undesired
characters.
* SC report(): Merged the "onlyselected" and "itemlist" parameter!
New syntax:
report([template], [itemlist], [header], [footer])
itemlist:
0 or "" = all current list items
1 = all currently selected list items
else = pipe(|)-separated list of items (full path).
Example for a report about a single specific item:
text report("
{Name},
{Size B} bytes,
{Modified yyyy-mm-dd hh:nn:ss},
ver {FileVersion}", "E:\XY\XYplorer\XYplorer.exe");
* Menu Go | Go to Last Target: Auto-selection of target items is not
dependent on the setting of "History retains selections" anymore.
It simply is done always.
! Spot & Jump: Would not spot a pattern when "Configuration |
General | Type-ahead find uses sorted column" was enabled and the
list was sorted by Ext, Type, or Path. Fixed. Spot & Jump now
always works on the Name column independently of this setting.
Note that BETA versions are work in progress and might contain fresh bugs. You have been warned.