Problem with the parameter "%O" and folders
Moderators: Hacker, petermad, Stefan2, white
Problem with the parameter "%O" and folders
%O places the current filename without extension into the command line
ex
Test.abc
If the folder name contains a do t(Test.abc), the "%O" parameter truncates the name after the dot (Test).
How do I prevent the "%O" parameter from renaming folders?
ex
Test.abc
If the folder name contains a do t(Test.abc), the "%O" parameter truncates the name after the dot (Test).
How do I prevent the "%O" parameter from renaming folders?
Re: Problem with the parameter "%O" and folders
Hi PiotrMPPL.
the %O-parameter behaves like indented by removing the part after the last dot from an object (file or folder name)
For to show you an solution we should know what you want to do at first place.
Probably you have to call an script which can differentiate between file and folder?
the %O-parameter behaves like indented by removing the part after the last dot from an object (file or folder name)
For to show you an solution we should know what you want to do at first place.
Probably you have to call an script which can differentiate between file and folder?
Re: Problem with the parameter "%O" and folders
Unfortunately TC functions don't check object type before extracting extension or name w/o extension. I completely agree that there FOLDERS should always have empty extension but FILES may have an extension after last dot in name.
E.g. MRT also cuts extensions from folder names. And internal TC information field [=tc.ext] does it too.
But, what's confusing, TC extension column shows no extension for folders, in brief view folder "extensions" are also shown exactly after names w/o tabulation. Inconsistensy!
Some older posts regarding similar problem:
https://ghisler.ch/board/viewtopic.php?f=3&t=47118
https://ghisler.ch/board/viewtopic.php?f=3&t=47731
https://ghisler.ch/board/viewtopic.php?f=3&t=36445
https://ghisler.ch/board/viewtopic.php?f=3&t=36395
ghisler,
Maybe you could finally add an option to separate folder extensions (and perhaps leave it enabled by default for those who uses that)? I really don't think that many people rely on folder extensions. So if the option is enabled, TC should show folder extensions in all extension columns and separate from name in all places, otherwise it shouldn't.
E.g. MRT also cuts extensions from folder names. And internal TC information field [=tc.ext] does it too.
But, what's confusing, TC extension column shows no extension for folders, in brief view folder "extensions" are also shown exactly after names w/o tabulation. Inconsistensy!
Some older posts regarding similar problem:
https://ghisler.ch/board/viewtopic.php?f=3&t=47118
https://ghisler.ch/board/viewtopic.php?f=3&t=47731
https://ghisler.ch/board/viewtopic.php?f=3&t=36445
https://ghisler.ch/board/viewtopic.php?f=3&t=36395
ghisler,
Maybe you could finally add an option to separate folder extensions (and perhaps leave it enabled by default for those who uses that)? I really don't think that many people rely on folder extensions. So if the option is enabled, TC should show folder extensions in all extension columns and separate from name in all places, otherwise it shouldn't.
Re: Problem with the parameter "%O" and folders
2PiotrMPPL
I agree - without knowing what you want to accomplish it is difficult to come up with solutions or woraroundsStefan2 wrote: 2020-11-11, 09:28 UTC For to show you an solution we should know what you want to do at first place.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: Problem with the parameter "%O" and folders
If this new mode of treatment for directory and file names is being implemented, i would prefer this being be a new parameter variables instead of an option, either to represent the the directory full name, file base name combination as well as the respective type-sensitive extension, or as a context switch parameter (which would switch the behavior of %O and %E; think of %X and %x). But it should not be a TC-wide option, because this would effectively lock TC into using only commands/buttons with %O and/or %E that either want the extension segregated from both file and directory names, or that want the extension segregated from file names only. But you wouldn't be able to use both kinds of commands/buttons without changing TC's configuration back and forth. Parameter variables, on the other hand, allows you to have commands/buttons who want to treat file names differently from directory names side by side next to commands/buttons which want to treat both directory and file names the same. And it would even allow you to use both modes of directory/file name treatment in the command line of the same command/button (if so desired).MVV wrote: 2020-11-11, 10:43 UTC Maybe you could finally add an option to separate folder extensions (and perhaps leave it enabled by default for those who uses that)? I really don't think that many people rely on folder extensions. So if the option is enabled, TC should show folder extensions in all extension columns and separate from name in all places, otherwise it shouldn't.
Re: Problem with the parameter "%O" and folders
elgonzo,
Do you see many different situations where this setting would matter and you would need different modes? I've never used folder extensions so I only need one mode.
But it sounds nice to add parameters that would allow referring to names and extensions in both modes, also perhaps some WDX fields with same values. I've just thought that it would be nice to refer to WDX fields just from TC buttons...
Do you see many different situations where this setting would matter and you would need different modes? I've never used folder extensions so I only need one mode.
But it sounds nice to add parameters that would allow referring to names and extensions in both modes, also perhaps some WDX fields with same values. I've just thought that it would be nice to refer to WDX fields just from TC buttons...
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: Problem with the parameter "%O" and folders
2MVV
I didn't think of any situations, nor do i want to speculate about what users are going to do vs. what users are not going to do, because i fear this will just end in an opinionated back-and-forth. I am used and totally fine with the current behavior of %O/%E. And since neither a new configuration option nor new parameter variables would change anything with regard to my TC environment. i am not that much invested into whatever form the implemented feature would take. But it should be without doubt that a "global" configuration setting would be less flexible, than having parameter variables for this purpose that can be used on a case-by-case basis. When comparing or weighing alternative approaches to solve a problem or implement a feature, i usually tend to favour the more flexible one when their advantages/disadvantages are otherwise equivalent.
Having the possiblity to reference WDX properties through parameter variables would be nice indeed. (I guess the source for the WDX property values would then be the file under the cursor; but i have to admit that i haven't put much thought into the practicality of other potentially possible sources such as source/target directory, for example.)
I didn't think of any situations, nor do i want to speculate about what users are going to do vs. what users are not going to do, because i fear this will just end in an opinionated back-and-forth. I am used and totally fine with the current behavior of %O/%E. And since neither a new configuration option nor new parameter variables would change anything with regard to my TC environment. i am not that much invested into whatever form the implemented feature would take. But it should be without doubt that a "global" configuration setting would be less flexible, than having parameter variables for this purpose that can be used on a case-by-case basis. When comparing or weighing alternative approaches to solve a problem or implement a feature, i usually tend to favour the more flexible one when their advantages/disadvantages are otherwise equivalent.
Having the possiblity to reference WDX properties through parameter variables would be nice indeed. (I guess the source for the WDX property values would then be the file under the cursor; but i have to admit that i haven't put much thought into the practicality of other potentially possible sources such as source/target directory, for example.)
Re: Problem with the parameter "%O" and folders
It is of course better to support both ways but this will require more work, e.g. adding another option to MRT dialog...