Xplorer2's Comments
Posted: 10 Mar 2012 12:47
Comments entered in Xplorer2 won't be shown in XYplorer. Why? Please help. Thanks.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Select such a file in the file list. Then paste this into the XY address bar and press <enter>:armsys wrote:Comments entered in Xplorer2 won't be shown in XYplorer. Why? Please help. Thanks.
Code: Select all
text property("DocComments");I hope some of the script cracks helps you on. I have no time today for it, sorry.armsys wrote:Yes, ::text property("DocComments"); can display the comments created by Xplorer2.
Then, how to create a script to convert all ADS comments into XYplorer?
Code: Select all
"Store DocComments in XY"
// If no selection act on the items displayed in the active pane.
$list = Report('{FullName}|', Get('CountSelected') > 0);
// Clean up the list a little.
$list = FormatList($list, 'ted');
$dirty = false;
// For every item
foreach ($item, $list) {
// Retrieve DocComments.
$docComment = Property('DocComments', $item);
if ($docComment UnLikeI '') {
// Retrieve existing XY comments.
$comment = Property('#Comment', $item);
if ($comment UnLikeI $docComment) {
if ($comment UnLikeI '') {
// Prepend DocComments to XY comments
$docComment = "$docComment<crlf>$comment";
}
// Store new comment
Tag "$docComment", $item, 2, 0;
$dirty = true;
}
}
}
if ($dirty) {
#195; // File | Settings | Save Tags
}Can someone please adapt the aforementioned code, so that the Comments on the file (xplorer2) are imported as Labels in XYplorer? The code above works but it imports them as Comments in XYplorer, and in my case I would like them to imported as Labels (essentially my comments in xplorer are used for folder coloring and that is why they must imported as Labels).TheQwerty wrote: ↑12 Mar 2012 12:17 I didn't have the time to really test this but it should prepend the DocComments to XY's comments. If there are selected items it will act only on them, otherwise it will act on all items displayed in the active list pane.If you're like thisCode: Select all
"Store DocComments in XY" // If no selection act on the items displayed in the active pane. $list = Report('{FullName}|', Get('CountSelected') > 0); // Clean up the list a little. $list = FormatList($list, 'ted'); $dirty = false; // For every item foreach ($item, $list) { // Retrieve DocComments. $docComment = Property('DocComments', $item); if ($docComment UnLikeI '') { // Retrieve existing XY comments. $comment = Property('#Comment', $item); if ($comment UnLikeI $docComment) { if ($comment UnLikeI '') { // Prepend DocComments to XY comments $docComment = "$docComment<crlf>$comment"; } // Store new comment Tag "$docComment", $item, 2, 0; $dirty = true; } } } if ($dirty) { #195; // File | Settings | Save Tags }and not quite sure where to put a script I suggest taking a 10-minute break and reading this: http://www.xyplorer.com/xyfc/viewtopic. ... 748#p53748
Code: Select all
"Store DocComments in XY"
// Choose your label color!
// Available by default: Red;Orange;Yellow;Green;Blue;Purple;Grey
$labelColor = "red";
// If no selection act on the items displayed in the active pane.
$list = Report('{FullName}|', Get('CountSelected') > 0);
// Clean up the list a little.
$list = formatlist($list, 'ted');
// For every item
$itemsToTag = "";
foreach ($item, $list) {
if (property('DocComments', $item) != '') {
$itemsToTag .= $item . "|";
}
}
if ($itemsToTag) {
tag $labelColor, trim($itemsToTag, "|", "R");
#195; // File | Settings | Save Tags
}
Code: Select all
"Store DocComments in XY"
// Choose your label color!
// Available by default: Red;Orange;Yellow;Green;Blue;Purple;Grey
$labelColor1 = "Red";
$labelColor2 = "Yellow";
$labelColor3 = "Green";
// If no selection act on the items displayed in the active pane.
$list = Report('{FullName}|', Get('CountSelected') > 0);
// Clean up the list a little.
$list = formatlist($list, 'ted');
// For every item
$itemsToTag1 = "";
$itemsToTag2 = "";
$itemsToTag3 = "";
foreach ($item, $list) {
$labelColor = Property('DocComments', $item);
if $labelColor == $labelColor1 {
$itemsToTag1 .= $item . "|";
}
if $labelColor == $labelColor2 {
$itemsToTag2 .= $item . "|";
}
if $labelColor == $labelColor3 {
$itemsToTag3 .= $item . "|";
}
}
if ($itemsToTag) {
tag $labelColor1, trim($itemsToTag1, "|", "R");
tag $labelColor2, trim($itemsToTag2, "|", "R");
tag $labelColor3, trim($itemsToTag3, "|", "R");
#195; // File | Settings | Save Tags
}Code: Select all
"Store DocComments in XY"
// If no selection act on the items displayed in the active pane.
$list = Report('{FullName}|', Get('CountSelected') > 0);
// Clean up the list a little.
$list = formatlist($list, 'ted');
// For every item
$itemsToTag = "";
foreach ($item, $list) {
$labelColor = Property('DocComments', $item);
if $labelColor != '' {
Tag "$labelColor", $item, 0, 0;
}
}
if ($itemsToTag) {
#195; // File | Settings | Save Tags
}