XY scripts Library - Discussion, Questions and etc.
Posted: 18 Aug 2010 01:32
Open discussion regarding XY scripts Library.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
::msg "Thank you very much, guys!"Code: Select all
(43 items)
GoogleCache_Library_About_QuickGoTo_search.htm
GoogleCache_Library_About_Selections_search.htm
GoogleCache_Library_Main_search.htm
=============================
Batch New Items.xys
Batch New Items_RECOVERED.xys
C4.xys
CollectItems.xys
CollectItems_28_97.xys
CollectItems_29_87.xys
common-jacky.xys
common-jacky_18_52.xys
common-jacky_18_53.xys
common-jacky_18_54.xys
common-jacky_Retrieved.xys
CopyHereFrom.xys
CountMove.xys
ExtractMovie.xys
ExtractMovie_19_59.xys
ExtractMovie_19_60.xys
ExtractMovie_19_63.xys
ExtractMovie_Retrieved.xys
ForEachItem.xys
Loop Through Selected Items.xys
MiniTree.xys
MiniTrees_17_62.xys
Multi-Item Rename.xys
Select.xys
SelectEveryX_thLineAndMore.xys
VirtualCopy_Older_ForEachItem.xys
XYplorer Automatic Updater.xys
XYplorer Automatic Updater_16_34.xys
XYplorer Automatic Updater_16_37.xys
XYplorer Automatic Updater_16_39.xys
XYplorer Automatic Updater_16_44.xys
XYplorer Automatic Updater_16_97.xys
=============================
_MultiWebSearch.xysNOTFOUND
_QuickFileEdit.xysNOTFOUND
_QuickGoTo.xysNOTFOUND
_ReportHTML.xysNOTFOUND
_Selections.xysNOTFOUNDCode: Select all
MultiWebSearch
SelectionsCode: Select all
Generate An HTML Listing Of The Current Folder
Here's an easy way to generate an HTML listing of the current folder. Here's what you need to do to use it :
1. Copy the following and paste it into a script file, e.g. GenerateReport.xys (Tip: Use Ctrl+Alt+V to Paste Text Into New File)
"Generate Report"
self $path, path;
$data = readfile("$path\Report Template.htm");
strpos $posB, $data, "<!-- BEGIN -->";
strpos $posE, $data, "<!-- END -->";
sub ( ( (($posB + $posE) == 0) + ($posB > $posE) ) == 0) ? "_doReport" : "_tplError";
"_tplError"
self $path, path;
msg "Unable to find a valid template in $path\Report Template.htm !";
"_doReport"
self $path, path;
$data = readfile("$path\Report Template.htm");
strpos $posB, $data, "<!-- BEGIN -->";
strpos $posE, $data, "<!-- END -->";
substr $header, $data, 0, $posB;
substr $footer, $data, $posE + 12;
substr $tpl, $data, $posB + 14, $posE - $posB - 14;
$header = $header, r;
$footer = $footer, r;
sortby Name, a;
sub (writefile("Report.html", report($tpl, 0, $header, $footer))) ? "_rptOk": "_rptError";
"_rptError"
msg "An error occured while generating the report to <curpath>\Report.html";
"_rptOk"
load ((confirm("Report generated !<br><curpath>\Report.html<br><br>Do you want to open it with the default browser ?")) ? 'open "<curpath>\Report.html";' : 'incr $void;'),,s;
2. Copy the following ans paste it into a file named Report Template.htm stored in the same folder as the script file above
<html><head><title>File Report For <curpath>\</title>
<style type="text/css">
body { font-family: "tahoma", "arial", "helvetica", "sans-serif"; font-size: 8pt; background-color: #FFFFFF; color: #000000; }
h1 { font-size: 14px; text-align: center; color: #0069DD; font-weight: bold; }
table { border-collapse: collapse; border: 1px solid #000000; background-color: #F6F6F6; }
tr.head { text-align: center; background-color: #E0E011; font-weight: bold; }
tr.zebra { color: #DD6900; }
td { font-family: "tahoma", "arial", "helvetica", "sans-serif"; font-size: 8pt; border: 1px solid #AAAAAA; }
td.center { text-align: center; }
td.right { text-align: right; }
</style></head><body><h1>File Report For <curpath>\</h1><table width="90%" align="center">
<tr class="head"><td rowspan=2 nowrap="nowrap">Name</td><td colspan=2 nowrap="nowrap">Size</td><td rowspan=2 nowrap="nowrap">Created</td><td rowspan=2 nowrap="nowrap">Modified</td></tr>
<tr class="head"><td nowrap="nowrap">Rounded</td><td nowrap="nowrap">Bytes</td></tr>
<!-- BEGIN --> <tr{Zebra | class="zebra"}{Dir style="background-color: #A2E2FA;"||}><td>{Name}</td><td class="center">{Size FLEXR}</td><td class="right">{Size B}</td><td class="center">{Created dd/mm/yyyy hh:nn:ss}</td><td class="center">{Created dd/mm/yyyy hh:nn:ss}</td></tr>
<!-- END -->
</table><br />Report generated on <date dd/mm/yyyy hh:nn:ss> by XYplorer v<xyver>
</body></html>
3. Go into any folder, and load the script file. A file Report.html will be generated in the current folder, based on the HTML template, and you will be asked if you want to open it (with your default Internet Browser).
4. Tweak the file Report Template.htm to your liking, using XY's Report Fields directly into the HTML, and putting the actual template (to be repeated for each item) in between <!-- BEGIN --> and <!-- END -->
-anyone interested in doing the commenting part of the job? (I WON'T, even partially, not for the next 2 or 3 years at least!) (Data Mining Tool may be of help with this, or a custom made tool - which also interests me!)Of course every scripter is welcome to create an account and share their scripts, that's the whole point!As you'll see, it works with a "version system" each requiring to include a version number (a.bb.cccc), the date the version was released (yyyy.mm.dd), the required version of XY, the changelog for this version and, of course, the actual XYS file.
...
And to make my life easier, as that was (also) the point herewhen uploading an XYS file and clicking on "Load file and try to auto-fill form" it will look for an Internal INI section at the end of the file, looking for keys name, version, requiredXY, and requiredCJ. (Note that if an extra key CJoptional is set to 1 then requiredCJ is ignored.)
It will also look for a changelog at the beginning of the file, and if formatted like I do mine it will extract the date and changelog for this version. For this to work, the XYS file must begin with a multi-line comment like this one:
Code:
/* Script Name
v0.01.0000 2009.01.18 XY v7.80.0032
+ changelog goes here
*/
I have not tried MultiWebSearch, but I wrote only SearchTheWeb. I vaguely recall that MultiWebSearch searched all given links (google, wikipedia etc) in one go, while mine has one button each for each search. BTW where can i find MultiWebSearch?SkyFrontier wrote:Perhaps the same as MultiWebSearch, but it's a Serendipity's script named SearchTheWeb.
Can someone please confirm...?
(I'm astonished by seeing such participative audience over here... wait... I can hear the heartbeat of a cricket, on the other side of the room!)
![]()
-one to go: Selections.
Don't know, sorry. XYwiki's down and I went heaven and hell after it and nothing thus far, even for the "Selections" script.BTW where can i find MultiWebSearch?
Updated (but not tested, sorry - not time for now). Thank you!