Is it possible to automatically rename a folder? |
Please read foobar2000 Tech Support Forum Rules before posting and comply with all the points.
Failure to provide all the information pointed out in the above document in your post is considered wasting other people's time and in extreme cases will lead to your topic getting locked without a reply.
See also: Hydrogenaudio Terms of Service.
![]() ![]() |
Is it possible to automatically rename a folder? |
May 13 2009, 07:28
Post
#1
|
|
|
Group: Members Posts: 18 Joined: 16-March 09 From: Germany Member No.: 68028 |
Hello,
what I wish for is a function to rename a folder (that contains an Album, Compilation, EP...) by its tag (group column). E.g. if I I have an album in my playlist that's correctly displayed as "Michael Jackson - Thriller" in the group column, but the folder is named as "surgery accident", it shall be possible to rename it by the group column. Is there any possibility? Greetings. This post has been edited by comox: May 13 2009, 07:29 |
|
|
|
May 13 2009, 08:36
Post
#2
|
|
|
Group: Members Posts: 33 Joined: 6-May 09 Member No.: 69563 |
As far as I know the only way to do that within foobar would be using:
right klick -> file operations -> move to... There you can setup the destination folder the way you want using %artist% - %album% (and you can rename the files to in the same go if you need to). Check "move entire source folder content" if your sure everything in the folder belongs there Once you have that setup right I would advise to save the setup as a preset. That way next time you need it will be included in the context menu. (right klick -> file operations -> move to... -> preset) But a simple "rename folder to..." would actually be nice. "nudge nudge wink wink devs say no more say no more" |
|
|
|
May 13 2009, 09:30
Post
#3
|
|
|
Group: Members Posts: 44 Joined: 5-September 08 Member No.: 57914 |
The problem is that there is no concept of relative addresses within Foobar file operations (my understanding anyway). So yes, you can rename the parent folder but you have to supply the path to that folder. If there were a token that you could use in the rename string for <current directory> or <parent directory>, you could make a preset for changing the name of the parent folder that would work anywhere within your file structure. There's probably a reason why such a thing was not included. It would be interesting to know the reason.
This post has been edited by d'Wooluf: May 13 2009, 09:31 |
|
|
|
May 13 2009, 12:08
Post
#4
|
|
![]() Group: FB2K Moderator Posts: 2359 Joined: 30-November 07 Member No.: 49158 |
If there were a token that you could use in the rename string for <current directory>... %path% = "C:\Music\Artist\Album\Track.mp3", $directory_path(%path%) = "C:\Music\Artist\Album\"...or <parent directory>, ... %path% = "C:\Music\Artist\Album\Track.mp3", $substr(%path%,0,$strrchr($substr(%path%,0,$sub($strrchr(%path%,\),1)),\)) = "C:\Music\Artist\"-------------------- Full-quoting makes you scroll past the same junk over and over.
|
|
|
|
May 13 2009, 12:17
Post
#5
|
|
|
Group: Members Posts: 244 Joined: 19-March 07 Member No.: 41623 |
|
|
|
|
May 13 2009, 12:20
Post
#6
|
|
|
Group: Members Posts: 33 Joined: 6-May 09 Member No.: 69563 |
I have been fiddeling around a bit with %path% in the "file operations...".
For some reasone it doesn't result in for example "C:\Music\Artist\". I end up with something like "C-\Music\Artist\" which makes it rather useless. Anyone else getting this result? |
|
|
|
May 13 2009, 12:25
Post
#7
|
|
|
Group: Members Posts: 244 Joined: 19-March 07 Member No.: 41623 |
You have to enter two queries: Destination Folder is the folder you want to put your music in (Say, C:\Music), then you can use a File Name Pattern: %artist% - %album%.
This post has been edited by Nemphael: May 13 2009, 12:26 |
|
|
|
May 13 2009, 12:40
Post
#8
|
|
|
Group: Members Posts: 33 Joined: 6-May 09 Member No.: 69563 |
I am aware of that
What I was trying to get was a way to make a preset "that would work anywhere within your file structure." as d'Wooluf said it so fitting. But it seems that title formatting cant be used in the first query for the destination folder. I tried to use $cut(%path%,3) which should leave just the "C:\" from what I understand. But I get an "invalid/nonexistent target folder" in the preview. EDIT: btw... sorry to the OP for somewhat hijacking the thread This post has been edited by FuzzyLogic: May 13 2009, 12:44 |
|
|
|
May 13 2009, 13:07
Post
#9
|
|
![]() Group: FB2K Moderator Posts: 2359 Joined: 30-November 07 Member No.: 49158 |
Only like this:
Destination folder: C:\ File Name Pattern: $substr(--whatever-custom-formatting-from-%path%--,3,999) This post has been edited by Yirkha: May 13 2009, 13:09
Reason for edit: ...
-------------------- Full-quoting makes you scroll past the same junk over and over.
|
|
|
|
May 21 2009, 15:26
Post
#10
|
|
![]() Group: Members Posts: 648 Joined: 10-January 06 From: Zagreb Member No.: 27018 |
I don't get this. If I do what you proposed
$substr(--%album artist% - %album%[ '['%date%']']/%tracknumber% - %title%--%path%,3,999) I get complete nonsense. When using just $substr(%path%,3,999) I get the current path. But I want to add a date at the end of a folder in [1987] format. How do I do that? now I have Yazoo - Only Yazoo (The Best Of) I want Yazoo - Only Yazoo (The Best Of) [1999] ...and to work in current folder. Where to put [ '['%date%']']? How? |
|
|
|
May 21 2009, 15:47
Post
#11
|
|
![]() Group: FB2K Moderator Posts: 2359 Joined: 30-November 07 Member No.: 49158 |
I meant the whole --whatever-custom-formatting-from-%path%-- as to be replaced.
Anyway, exactly for what you want to do: $substr(%path%,3,$sub($strrchr(%path%,\),1))' ['%date%']'\%filename% $substr(%path%,3,$sub($strrchr(%path%,\),1)) -- Get the part from from the 4th char (skip the C:\ prefix) to the last \ (at the end of the last directory name). ' ['%date%']'\%filename% -- Append the date in brackets, then use the original filenames in the folder. This post has been edited by Yirkha: May 21 2009, 15:47 -------------------- Full-quoting makes you scroll past the same junk over and over.
|
|
|
|
May 22 2009, 00:11
Post
#12
|
|
![]() Group: Members Posts: 648 Joined: 10-January 06 From: Zagreb Member No.: 27018 |
Yirkha, thank you, it works as intended.
I just don't understand this scripting, thank you for helping. |
|
|
|
Jan 31 2013, 10:19
Post
#13
|
|
![]() Group: Members Posts: 32 Joined: 5-September 04 Member No.: 16788 |
Only like this: Destination folder: C:\ Hi, I'm resurrecting this very old - and interesting - thread to ask if, as of today, your workaround is still necessary, or if "Destination folder" can be scripted to guess the drive where the files are. In my case, music can be on C: or on N:, and I'd like to move my files from CODE [Drive]:\[original path]\[original filename].mp3 to CODE [Same drive]:\$directory_path(%path%)\%album%\$num(%discnumber%,2).%tracknumber%-%totaltracks% %artist% - %title%
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 21st May 2013 - 17:35 |