Custom Columns

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

Re: Custom Columns

Post by kunkel321 » 22 Mar 2014 23:27

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: 49770
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Custom Columns

Post by admin » 23 Mar 2014 07:55

I cannot guarantee it, but you have a good chance.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

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

Re: Custom Columns

Post by kunkel321 » 30 Mar 2014 23:26

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: 49770
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Custom Columns

Post by admin » 31 Mar 2014 08:35

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.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

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

Re: Custom Columns

Post by LittleBiG » 31 Mar 2014 11:48

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: 49770
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Custom Columns

Post by admin » 02 Apr 2014 22:29

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.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

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

Re: Custom Columns

Post by TheQwerty » 09 Apr 2014 18:27

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: 1540
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom Columns

Post by LittleBiG » 09 Apr 2014 19:16

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: 4353
Joined: 03 Aug 2007 22:30

Re: Custom Columns

Post by TheQwerty » 09 Apr 2014 21:02

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: 590
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Custom Columns

Post by kunkel321 » 09 Apr 2014 22:48

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: 49770
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Custom Columns

Post by admin » 10 Apr 2014 10:02

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

I'm currently collecting ideas for Custom Columns 2.0.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

admin
Site Admin
Posts: 49770
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Custom Columns

Post by admin » 10 Apr 2014 10:04

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.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

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

Re: Custom Columns

Post by binocular222 » 12 Apr 2014 18:11

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

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

Re: Custom Columns

Post by SammaySarkar » 12 Apr 2014 21:03

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

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

Re: Custom Columns

Post by TheQwerty » 12 Apr 2014 21:26

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