Xplorer2's Comments

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Xplorer2's Comments

Post by armsys »

Comments entered in Xplorer2 won't be shown in XYplorer. Why? Please help. Thanks.

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: Xplorer2's Comments

Post by Marco »

Probably because xplorer2 uses ntfs ADS, while XY uses its own database for tags, labels and comments.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Xplorer2's Comments

Post by armsys »

Marco,
Thanks for your amazingly fast reply.
Thanks for explaining the trick.
Is it possible to copy the ADS comments into XY by a script?

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: Xplorer2's Comments

Post by Marco »

Sure, as long as you can read the ADS, but I don't know of any CL utility for that atm.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 60588
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Xplorer2's Comments

Post by admin »

armsys wrote:Comments entered in Xplorer2 won't be shown in XYplorer. Why? Please help. Thanks.
Select such a file in the file list. Then paste this into the XY address bar and press <enter>:

Code: Select all

text property("DocComments");
Do you see the comment? If yes it will be easy to write a script to generate XY comments from ADS comments.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Xplorer2's Comments

Post by armsys »

Yes, ::text property("DocComments"); can display the comments created by Xplorer2.
Then, how to create a script to convert all ADS comments into XYplorer?

admin
Site Admin
Posts: 60588
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Xplorer2's Comments

Post by admin »

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?
I hope some of the script cracks helps you on. I have no time today for it, sorry.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Xplorer2's Comments

Post by TheQwerty »

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.

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
	}
If you're like this :shock: 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

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Xplorer2's Comments

Post by armsys »

Hi TheQwerty,
Thanks for your fast and thorough help.

jonhyq
Posts: 9
Joined: 13 Apr 2020 10:52

Re: Xplorer2's Comments

Post by jonhyq »

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.

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
	}
If you're like this :shock: 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
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).

I am considering to make the jump to XYplorer but this holds me back, I don't want to lose all my file tags.

Thank you in advance

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Xplorer2's Comments

Post by highend »

Completely untested (but if it works it's rather fast because of only tagging once, not every single file one at a time)...

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
    }
One of my scripts helped you out? Please donate via Paypal

jonhyq
Posts: 9
Joined: 13 Apr 2020 10:52

Re: Xplorer2's Comments

Post by jonhyq »

Thank you highend for your help. Although your code did not work (it was applying to all files the same Label defined), it proved to be very helpful. Based on that I was able to modify it and have the functionality as I wanted. I put it below, since it might be helpful to others. The code deals with 3 defined colors, if someone needs more, all he needs to do is copy the relevant sections more times, it's easy to see the pattern.

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
    }
The aforementioned code should be fast as highend indicated. If it's too much hassle for someone to modify the code (or does not understand), I am also providing a modified version of the code that is fully automatic and goes each file one by one and whatever "Comment" it has, it makes it a Label for use by XYplorer. It might be more slow of course.

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
    }

Post Reply