Content plugin to retrieve a file's parent directory?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Content plugin to retrieve a file's parent directory?

Post by *StickyNomad »

I searched for a plugin with such feature, but without success, so: does anybody know if a content plugin exists that delivers a file's parent directory and let me specify parts of that name?

Here's an example to show you what I mean:

I store my MP3 albums always in such way:
\Artist\Year Albumtitle\TrackNr - Songname.mp3 , e.g

\Tool\2001 Lateralus\01 - The Grudge.mp3

Now it would be great if I could select mp3 files, read their parent dir and write specific parts of this dirname to e.g. id3 fields using Lefteous' summary plugin via File->Attributes:

[parent:1-4] -> Summary.year ('2001')
[parent:6-] -> Summary.album ('Lateralus')

to go further, if it would be possible to parameterize the parent path, you could access any desired upper directory level (parent0, parent1,...), e.g.
[parent1] -> Summary.artist would write 'Tool' to a files 'artist'-tag

The selection of a string part is already possible (e.g. with TCs internal content plugin: [=tc.Name:6-]), so writing trackNr and filename to the according id3 fields is already possible, but I miss the described possibility to somehow access specific parts of a file's path in that way. The plugin I'm looking for does not to have write support, I just want to read the path info.

If no such plugin is available yet, maybe someone with the necessary skills is willing to provide a plugin with such feature...

The other way round (writing tag info to filename) is already possible with the MultiRenameTool. If the described functionality would be available, this would certainly allow me to uninstall my so-far used ID3 tagger. This would be perhaps the 8th or 9th external tool that TC has replaced on my system. :)
User avatar
petermad
Power Member
Power Member
Posts: 16030
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2StickyNomad

Well, it is not exactly the parent dir, but maybe [=tc.path] could be of some help to you - but maybe you already tried that.
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
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2StickyNomad
If 2 levels of parents is good for you - contact with me by mail.
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2petermad

Thanks for the info. But [=tc.path] delivers the full path, which is not as flexible as what I'm looking for. I could use those parts of the full path, but the disadvantage here is that I would have to adjust the path parts if the mp3 folder is contained in a different directory (e.g. MP3/Rock, MP3/pop, MP3/Soundtrack)

With retreiving the parent path only, I could use one single preset for all my MP3 files, disregarding where the 'Artist-root-directory' is stored in the directory tree. But thanks nevertheless!

VadiMGP

Thanks, I will do that.
User avatar
Lev
Junior Member
Junior Member
Posts: 82
Joined: 2004-12-14, 13:08 UTC

Post by *Lev »

I think you can use Script Content Plugin for retrieving parts of a full path.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2StickyNomad
FooBar2000 is capable to do what you described and more.
I switched to Linux, bye and thanks for all the fish!
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Code: Select all

'parent.vbs by tbeu

'Script for Script Content Plugin (c)Lev Freidin, 2005
'http://www.totalcmd.net/plugring/script_wdx.html
'http://wincmd.ru/plugring/script_wdx.html

'This script returns the parent directory name of a file

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
parentPath = fso.GetParentFolderName(filename)
parentPathArray = Split(parentPath, "\")
content = parentPathArray(UBound(parentPathArray))
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

Thanks for the additional info guys!

The Plugin VadiMGP sent me does already exactly what I want, but thanks anyway.

2SanskritFritz
Thanks too for that info. But I was actually looking for a way to do that explicitely in TC, as I am currently evaluating if TC could replace my ID3 tagger. And the chances are good so far :)

There is still no plugin available that can write all id3 tags, but Lefteous' Summary plugin is a good start, and I tagging works quite comfortable in TC already. Press CTRL+B, apply saved attributes set and BAM! Dozens of MP3 albums tagged in a rush without having to leave my beloved File manager :)
User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Post by *sas2000 »

 
2VadiMGP & StickyNomad 

StickyNomad wrote: The Plugin VadiMGP sent me does already exactly what I want
May you share the plugin with us or is still under development ?. Thanks.
 
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2sas2000

VadiMGP wrote that plugin for himself as he said, but maybe he doesn't mind making it available here...
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2sas2000
This plugin isn't some "secret" plugin. :) It is a new version of FileX plugin. Wait a few days, I think at weekend I'll release it.
User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Post by *sas2000 »

 
VadiMGP wrote: This plugin isn't some "secret" plugin. :) It is a new version of FileX plugin. Wait a few days
Thanks :!:
 
Post Reply