Custom Columns

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
kunkel321
Posts: 645
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Custom Columns

Post by kunkel321 »

admin wrote:And hey, I just took your "Context Smart Columns" -- nice catchy term! Thanks! :appl:
Very good! 8)
I must say, that I think SkyFrontier was correct in hyphenating it... "Context-Smart"

Question: Can we start building up our list of user-defined columns, or will they again get wiped out with the newer betas (as you warned about before)?
ste(phen|ve) kunkel

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

Re: Custom Columns

Post by admin »

I cannot guarantee it, but you have a good chance.

kunkel321
Posts: 645
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Custom Columns

Post by kunkel321 »

Coolest ever mixed columns setup:
Image

It uses the following mix hierarchy:
Image

"Dimensions" is the default one that Don has in there.

"N Icons" is a Template with
Icons: <get counticons "<cc_item>">' //Thanks for adding this Don!
Type: Files,
Filter: dll;icl

"Just size" is the plain old property "size"
Type: Files
Filter: "*.*" (actually type in the asterisk dot asterisk)

"Count" is a script CC with
$tst = "<cc_isfolder>";
if("$tst" == "0") { }
elseif("$tst" == "1") {
$files = trim(folderreport("files", "r", "<cc_item>", ""), "<crlf>");
$dirs = trim(folderreport("dirs", "r", "<cc_item>", ""), "<crlf>");
$files = gettoken("$files", count, "<crlf>");
$dirs = gettoken("$dirs", count, "<crlf>");
return "Files: $files, Dirs: $dirs";
}
//Thanks for the script SkyFrontier!
Type: Folder
Filter: Blank.

Note that you can't have two different sub-columns, each with a blank Filter field. (Even if one is "files-only" and one is "folders-only.") As such, the "Just size" column has to come first and has to filter-out any folders, by using an explicit "*.*" (The unfortunate side effect, is that if a folder has a dot (such as "My Folder 2.0") the Mixed CC will be blank for that item.
ste(phen|ve) kunkel

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

Re: Custom Columns

Post by admin »

Cool indeed!
kunkel321 wrote:Note that you can't have two different sub-columns, each with a blank Filter field. (Even if one is "files-only" and one is "folders-only.") As such, the "Just size" column has to come first and has to filter-out any folders, by using an explicit "*.*" (The unfortunate side effect, is that if a folder has a dot (such as "My Folder 2.0") the Mixed CC will be blank for that item.
I might improve that in a later version.

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom Columns

Post by LittleBiG »

admin wrote:I might improve that in a later version.
I also hope you will.

I tried to solve the folder size caching. Saved Folder Size (Extra 4) filler script:

Code: Select all

$token = "";
  foreach($token,formatlist(folderreport("dirs:{fullname},{size RAW}|","r",,,,"|"),"e")) {
    tag(replace(gettoken($token,2,",")," "), gettoken($token,1,","), ex4, 1);
  }
The I tried to create a mixed column from other two:
1. column for all folders: shows an already saved size from Extra 4

Code: Select all

return report("{extra 4}","<cc_item>");
2. column for all files: normal size property

These 2 cannot be shown in one mixed column. They are ok separately, so...

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

Re: Custom Columns

Post by admin »

Tip: Thanks to the new possibility to search by custom column definition, scripted custom columns can serve as search templates for infinitely complex search jobs.

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

Re: Custom Columns

Post by TheQwerty »

Network Locations... :x

I think we need a new variable <cc_isnetwork> so scripts can act appropriately.
It might also be desirable to include an option so CCs can be configured to "Include Network Locations".


For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom Columns

Post by LittleBiG »

TheQwerty wrote:For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
I think the earlier mentioned "cc is calculated only for the visible rows" is better approach.

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

Re: Custom Columns

Post by TheQwerty »

LittleBiG wrote:
TheQwerty wrote:For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
I think the earlier mentioned "cc is calculated only for the visible rows" is better approach.
They tackle different issues... Only running scripts for the visible items minimizes the total amount of time required before information can be shown.

My suggestion is that there should be a way to limit the total amount of execution time for any single instance of the script (each item in the list kicks off a new instance of the script).

It's a moot example now but consider the case of a CC script that calculates a hash. The delay it adds when browsing folders containing many small files might not be bad, but navigate to a folder containing GB+ files and you can't hit Escape quick enough.


What I'm suggesting is I'd change my script to:

Code: Select all

ExecutionTimeout 500, 'skipped';
return hash('md5', <cc_item>, 1);
Now when XY executes the script if it takes longer than 500 ms to run the portion following the ExecutionTimeout SC then XY will abort the script and use the value 'skipped' - so it will be as if the script returned 'skipped'.


Admittedly, I'm not in love with this solution but I do like it better than a global configuration/tweak timeout value. Perhaps it would be better as two new options that are available in the CCC dialog for scripts. :?

kunkel321
Posts: 645
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Custom Columns

Post by kunkel321 »

In regard to the slowness of certain columns: Another idea.... In the CC definition GUI form thingy, Don could have a checkbox for "[ ] This property only gets calculated on selection."

For example the Script CC that calculates "N Dirs, N Files" for folders could be marked as "on selection only." Then the folders contents don't get calculated unless I click on the item. It this were part of a Mixed Column, the fast calculations would happen straight away, but the slower ones would not calculate unless the folder/file was clicked on.
ste(phen|ve) kunkel

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

Re: Custom Columns

Post by admin »

Yes, this is planned since http://www.xyplorer.com/xyfc/viewtopic. ... 35#p102035

I'm currently collecting ideas for Custom Columns 2.0.

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

Re: Custom Columns

Post by admin »

TheQwerty wrote:Network Locations... :x

I think we need a new variable <cc_isnetwork> so scripts can act appropriately.
It might also be desirable to include an option so CCs can be configured to "Include Network Locations".


For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
Yeah, I add it to my CC 2.0 list.

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Custom Columns

Post by binocular222 »

I suggest adding <cc_ext> variable
Instead of set up a few columns with specific ext.filter, then create mixed column to aggregate => should create only 1 scripted column which return specific data per each file extension
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Custom Columns

Post by bdeshi »

Add Checkboxes.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Custom Columns

Post by TheQwerty »

Running scripts on click...
Checkboxes...


Sure sounds like maybe someone was right that extra columns and custom columns shouldn't be separate things! :whistle: :P

Post Reply