Page 1 of 1

Extended [P] [G] options in MRT

Posted: 2013-10-17, 20:11 UTC
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.

Posted: 2013-10-18, 05:42 UTC
by Vochomurka

Posted: 2013-10-18, 06:11 UTC
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.

Posted: 2013-10-18, 22:36 UTC
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]

Posted: 2013-10-19, 11:36 UTC
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.