Change display of file type descriptions?
Change display of file type descriptions?
Is it possible the have the file type description in the list changed like the file associations and file icons can be changed. I don't want to change "open with" functions or anything else. There are utilities to do this but MSoft has made it nearly impossible to do it simply and cleanly (just try changing .bmp files to display "Bitmap Image" instead of "BMP File" - you can't). Or am I missing something?
Re: Change display of file type descriptions?
Add your own scripted custom column
or with a switch statement:
Code: Select all
$type = property("System.ItemTypeText", <cc_item>);
if ($type LikeI "BMP File") {
return "Bitmap Image";
} elseif ($type LikeI "XLSX File") {
return "Excel Document";
}
return $type;
Code: Select all
$type = property("System.ItemTypeText", <cc_item>);
switch ($type) {
case "BMP File":
$type = "Bitmap Image";
break;
case "XLSX File":
$type = "Excel Document";
break;
}
return $type;
One of my scripts helped you out? Please donate via Paypal
Re: Change display of file type descriptions?
I DID miss something! Thanks so much for the quick reply. I had not done my homework and investigated scripting in XYPlorer but I will remedy that today. The proposed solutions will work for me with a little work for the first implementaton and then I can use it anywhere. Much appreciated "highend". PS - XYPlorer is the greatest file manager and the only peice of software I've actually bought a lifetime license for. Freeware usually suffices.
Re: Change display of file type descriptions?
Slight problem. I followed your advice using the switch type setup. The problem is that I created an entry for all 500 or so registered extensions so I could fill in the desired description When I pasted that script into the XYPlorer Custom Column form, it stopped accepting text about 7/8s of the way through. The full script is about 1460 lines with 33,600 characters. I assume i've run into a limit. Maybe in the edit box on the custom column form and maybe some other restriction. I tried to find where the script was saved but it hides well. Not in the registry, not in any file in XYPlorer directory. I know 500 entries is a lot and the script is quite large but it works perfectly otherwise. Is there a solution somewhere? I'd really like even up to 1000 registered extensions if possible. Allocate more memory for scripts maybe?
Re: Change display of file type descriptions?
It's in the XYplorer.ini file.
Make it shorter and really, stick to those which really need to be modified:
Make it shorter and really, stick to those which really need to be modified:
Code: Select all
$types = <<<>>>
BMP File|Bitmap Image
XLSX File|Excel Document
original entry|the one you want to display...
>>>;
$type = property("System.ItemTypeText", <cc_item>);
$pattern = regexreplace($type, "([\\^$.+()\[{])", "\$1");
$match = regexmatches($types, "^" . $pattern . "\|.+?$");
if ($match) { return gettoken($match, 2, "|"); }
return $type;
One of my scripts helped you out? Please donate via Paypal
Re: Change display of file type descriptions?
"highend" I bow down before your superior ability! Many thanks again. I reduced script file from 30k to 20k just removing unneeded spaces. Your last script piece will reduce it even more. Also didn't realize that INI file latest version was highest number like -01, -02, etc. so I finally saw where script was stored and how. Total success for acheiving my aim once I had some pointers. I adapted it like this:
and so on....this made it shorter some too. Now to adapt to your last suggestion - a little more homework I can figure out on my own.
$ext = property("System.ItemType", <cc_item>);
$type = property("System.ItemTypeText", <cc_item>);
switch ($ext) {
case ".386":$type = "Virtual Device Driver";break;
case ".3fr":$type = "Hasselblad Digital Image";break;and so on....this made it shorter some too. Now to adapt to your last suggestion - a little more homework I can figure out on my own.
-
admin
- Site Admin
- Posts: 65387
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Change display of file type descriptions?
Make it a little faster and shorter by using
<cc_ext> which returns the extension faster and without the dot.FAQ | XY News RSS | XY X
Re: Change display of file type descriptions?
What Don means:
Code: Select all
$types = <<<>>>
386|Virtual Device Driver
3fr|Hasselblad Digital Image
>>>;
$pattern = regexreplace(<cc_ext>, "([\\^$.+()\[{])", "\$1");
$match = regexmatches($types, "^" . $pattern . "\|.+?$");
if ($match) { return gettoken($match, 2, "|"); }
return property("System.ItemTypeText", <cc_item>);
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 65387
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Change display of file type descriptions?
I rather meant this:
Code: Select all
switch (<cc_ext>) {
case "386":$type = "Virtual Device Driver";break;
case "3fr":$type = "Hasselblad Digital Image";break;
...FAQ | XY News RSS | XY X
Re: Change display of file type descriptions?
That will add up (doing it with
switch) to quite a lot of unnecessary chars for the script. Use the heredoc version...One of my scripts helped you out? Please donate via Paypal
Re: Change display of file type descriptions?
Thanks for this. I used highend's last offered script, works fantastic. Clever stuff. 
XYplorer Beta Club