Extended [P] [G] options in MRT

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Extended [P] [G] options in MRT

Post by *Balderstrom »

I propose a new syntax for utilizing [P]arent in the MRT.

Since in the MRT, you cannot reference the path further than 2 levels up.
[P::-1] equivalent to [P]
[P::-1,1] equivalent to [P]
[P::-2] equivalent to [G]
[P::-2,1] equivalent to [G]
[P::-2,2] equivalent to [G][P]
Given a path such as X:\MUSIC\ROCK\ACDC\Razors Edge\
[P::1] would result in: MUSIC
[P::-4] would result in MUSIC
[P::2] would result in: ROCK
[P::1,2] would result in: MUSICROCK
[P::-1] would result in: Razors Edge
[P::-4,4] would result in: MUSICROCKACDCRazors Edge
etc.
I propose the double colon as a single colon is utilized in "Custom Columns" syntax.
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Single user license #329241
PowerPro scripts for Total Commander
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom,
And how will it be mixed with existing substring extractions?
[P1]
[P2-5]
[P2,5]
[P2-]
[P02-9]
[P 2-9]
[P-8,5]
[P-8-5]
[P2--5]
[P-5-]
I think [P(-1)] (like function call) is better than [P::-1] because it is compatible with substring extractions. So, [P(-1)2-5] would be "azor", [P(-1)-8,5] would be "ors E" and [P(-1)-5-] would be " Edge".

However such functionality may be easilly achieved using content plugin that returns path parts.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I would think the syntax would need to be placed at the end of the current syntax:

e.g.
[P2,5::-1] equivalent to [P2,5]
[P2--5::-1] equivalent to [P2--5]
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It doesn't sound good. Currently we have P, then 2--5 cuts from it some characters... and then your appendix ::-1 will be completely misleading because it can't be applied to result of previous operation: firstly we must take P (first item) and ::-1 (last item) and only after than we can take substring (middle part), weird command order.
My one is sequential: you have P or P(-1), and then you take part of a string.
Post Reply