Page 1 of 2

Directory sorting

Posted: 01 Oct 2019 08:44
by MrYang
Is there such a function?

Similar to Destop.ini, for example, there is an XYplorer.ini in the directory that stores the order of folders/files.

For example, there are six files in the directory:
A.txt
B.txt
C.txt
D.txt
E.txt
F.txt

The contents saved in XYplorer.ini are:
D.txt
C.txt

Then the order of directories is:
D.txt
C.txt
A.txt
B.txt
E.txt
F.txt

We can create an XYplorer. ini under any directory, and we can edit XYplorer. ini freely.

Re: Directory sorting

Posted: 01 Oct 2019 08:59
by jupe
Yes you could script this, lookup the scripting command sortbylist (I made a quick example below).

Code: Select all

  sortbylist(readfile("sortorder.ini"));
Also a similar feature FYI:
https://www.xyplorer.com/release_14.30.php#PCSO
https://www.xyplorer.com/release_16.60.php#PCSO

Re: Directory sorting

Posted: 01 Oct 2019 09:10
by highend
And please don't name these files "XYplorer.ini"^^

Re: Directory sorting

Posted: 01 Oct 2019 10:07
by admin
In the meantime I updated the screenshots in release_16.60.php. They are still blank release_14.30.php. (Some criminal lawyers from Hamburg had sued me for using some photos in the thumbs shown in the screenshots... :blackstorm: )

Re: Directory sorting

Posted: 01 Oct 2019 11:05
by MrYang
Thanks very much.

If I use scripts, can the XYplorer execute the specified scripts automatically after I click on a folder?

Every time a folder is opened, the specified script is executed manually, which is inconvenient.

Re: Directory sorting

Posted: 01 Oct 2019 11:45
by admin
How many folders do you have that need a custom sort order?

Re: Directory sorting

Posted: 01 Oct 2019 12:17
by MrYang
In work, many folders need to be categorized. (Classify folders. It's not just files..)

Besides, my stronger need is:
When I browse the Internet, I will screen-capture good articles and materials, there will be more than a dozen or dozens of files in the folder, I hope to sort by category.

I also have a strong need:
There can be some horizontal splitting in the file list. Just like in the menu, it's easy to add a dividing line, which is to use "-".
snap_screen_20191001192531.png

Re: Directory sorting

Posted: 01 Oct 2019 20:03
by admin
If that's a strong need you should probably look somewhere else. XYplorer won't have this kind grouping too soon.

Re: Directory sorting

Posted: 02 Oct 2019 02:48
by MrYang
1. This function was implemented half a year ago, but it is not perfect.
Half a year ago, in order to achieve the custom sorting of folders and add dividing lines, I wrote a script of about 4KB, which was implemented with PaperFolder.
I placed a file in the folder that needed sorting, such as "SortOrder.txt", and I right-clicked in the margin of the list, clicked on the first item, and the folder was sorted.
snap_screen_20191002091618.png
But I don't think it's perfect enough.


2. "Manual Sorting" seems to be a problem
For example, there are three folders:

Code: Select all

111
222
333
Step 1: Download the software
Step 2: Set Tools|Customize List|Manual Sorting
Step 3: Move folder 222 to front of folder 111
Step 4: Open folder 111, then click the "Up" button to return to the previous directory.

Now folder 111 is in front of folder 222.
In fact, this is a very good function, and maybe many users will give up this function just like me.


3. It is not difficult to realize this function.
As we all know, in Explorer, there is "Desktop.ini" to achieve personalized functions, such as changing the folder icon.
XYplorer can also have "SortOrder.ini".
For example, the content in "SortOrder.ini" is as follows:

Code: Select all

222
-        // Use '-' to increase the dividing line
111
333
Each time a folder is opened, XYplorer determines whether there is a "SortOrder.ini" file under the folder, and if so, execute the script "sortbylist".
snap_screen_20191002092016.png



1、这个功能半年前实现了,只是不完美
半年前,为了实现文件夹的自定义排序,以及增加分割线,我写了大概4KB的脚本,用PaperFolder实现了。
我在需要排序的文件夹中放了一个文件,例如“SortOrder.txt”,我在列表的空白处点击右键,点击第一项,文件夹就排序好了。
只是我觉得这样还不够完美。

2、“Manual Sorting”好像有点问题
例如,有3个文件夹:

Code: Select all

111
222
333
第1步:下载软件
第2步:设置Tools|Customize List|Manual Sorting
第3步:移动文件夹222到文件夹111的前面
第4步:打开文件夹111,然后点击“Up”按钮返回上一级目录。
现在文件夹111在文件夹222的前面。
其实这是一个非常棒的功能,可能很多使用者会跟我一样放弃了这个功能。

3、实现这个功能不难
众所周知,在Explorer中有“Desktop.ini”,实现个性化的功能,比如更改文件夹的图标。
XYplorer也可以有“SortOrder.ini”。
例如“SortOrder.ini”中的内容是这样的:

Code: Select all

222
-        // 用“-”来增加分割线
111
333
每次打开文件夹的时候,XYplorer判断该文件夹下是否有“SortOrder.ini”文件,如果有的话,执行脚本“sortbylist”即可。

Re: Directory sorting

Posted: 02 Oct 2019 08:00
by admin
Manual Sorting is stored per tab, not per folder.

Re: Directory sorting

Posted: 02 Oct 2019 08:45
by MrYang
admin wrote: 02 Oct 2019 08:00 Manual Sorting is stored per tab, not per folder.
Could you explain it, please? I really don't understand.



"Since v16.60 there is Permanent Custom Sort Order (PCSO): The custom sort order is remembered per tab, across tab switches, and across sessions, and on an explicit List Refresh."

I read the help document, but I still don't understand it.

Re: Directory sorting

Posted: 02 Oct 2019 09:07
by admin

Re: Directory sorting

Posted: 02 Oct 2019 09:35
by MrYang
My understanding is as follows:

There is a tab A showing three folders:

Code: Select all

111
222
333
Step 1: Set Tools|Customize List|Manual Sorting
Step 2: Move folder 222 to the front of folder 111.
Step 3: Now switch to tab B.
Step 4: Switch to tab A.

Now folder 222 is in front of folder 111.

Step 5: Open folder 111, then click the "Up" button to return to the previous directory.

Now folder 111 is in front of folder 222.

But.
This is only a little useful. It's not very useful.

When I was looking for a job 10 years ago, I contacted my HR. There were many folders under one of her folders. This method was used to sort folders.

Code: Select all

01-CCC
02-AAA
11-HHH
12-DDD
If one day, she needs to adjust the order of folders, rename folder 12-DDD to 03-DDD, then some shortcuts(*.lnk) may fail. (The previously saved shortcuts will fail, and clicking on the shortcuts will not find the path.) But in fact, folder names are all DDD, adding some numbers just for sorting.

Re: Directory sorting

Posted: 02 Oct 2019 09:55
by jupe
in my opinion for what you are trying to achieve you would be better using an Extra "soft column", and tagging each file with an index number, then you will have a column to sort by that will be permanent, and won't require an external file in each folder, won't require renaming files, and can be remembered on location or tab changes, and even permanently saved as the default sorting method via FVS

https://www.xyplorer.com/release_13.80.php#ExtraTags

Re: Directory sorting

Posted: 02 Oct 2019 10:13
by MrYang
Before adjusting the order:

Code: Select all

AAA  (Marked as: 1)
BBB  (Marked as: 2)
CCC  (Marked as: 3)
DDD  (Marked as: 4)
EEE  (Marked as: 5)
After adjusting the order:

Code: Select all

AAA  (Marked as: 1)
EEE  (Marked as: 2)
BBB  (Marked as: 3)
CCC  (Marked as: 4)
DDD  (Marked as: 5)
According to your method, folder EEE, folder BBB, folder CCC and folder DDD need to be re marked.
It takes a lot of time if there are more than ten folders that need to be re marked.