I try to rename the parent folder from metadata of a mp3 file.
Rename FILEINFO "{filepath$|..|noterm}" TO="{mp3artist} - {mp3album} ({mp3year})"
But don't work
I try to rename the parent folder from metadata of a mp3 file.
Rename FILEINFO "{filepath$|..|noterm}" TO="{mp3artist} - {mp3album} ({mp3year})"
But don't work
You can't do it like that. That command is using the parent folder name as a rename pattern to rename the selected file not the parent folder.
If you want to use one file's information to rename something else (e.g. it's parent folder), you'll have to use a rename script.
(You can move the file itself to a new folder, but that would not remove the old parent folder, nor bring along any other files in the same folder unless they also had the same metadata. e.g. A bunch of tagged MP3 files could be moved that way, but a playlist or coverart image int he same folder would not move with them without using a script.)
I play with script and i need help. On this simple example, i want to move all selected file to folder name by value "artist".
@nodeselect
Rename FILEINFO TO="{mp3artist}"
@script vbscript
Option Explicit
dim DOpusRTPath
DOpusRTPath = "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe"
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim fFirst
fFirst = TRUE
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
Dim strCommand
Dim artist
if fFirst then
fFirst = FALSE
artist = strNewName
strCommand = """" & DOpusRTPath & """ /cmd Copy MOVE HERE CREATEFOLDER="" & artist"""
Shell.Run strCommand,0,false
end if
strNewName = ""
End Function
But files are move to folder named "& artist"... I need help...
Try this:
@nodeselect
Rename FILEINFO TO="{mp3artist}\*"
Thanks but I know that...
My script does not do anything useful by itself, but i want to play with script...
Did you try this one? Possibly you can modify it to your needs:
[url]Sort music files and go to the target folder]
Here the good script...
@nodeselect
Rename FILEINFO TO="{mp3artist}_{mp3album}_{mp3year}"
@script vbscript
Option Explicit
dim DOpusRTPath
DOpusRTPath = "C:\Program Files\Directory Opus\dopusrt.exe"
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim fFirst
fFirst = TRUE
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
Dim strCommand
Dim artist
Dim strInfoArray
Dim album
Dim annee
strInfoArray = split(strNewName, "_")
strNewName = ""
If fFirst Then
fFirst = FALSE
artist = strInfoArray(0)
album = strInfoArray(1)
annee = strInfoArray(2)
strCommand = """" & DOpusRTPath & """ /cmd Rename {filepath$|..|noterm} TO=""" & artist & " - " & album & " (" & annee & ")"""
Shell.Run strCommand,0,false
End if
End Function
Nice one!
Works fine for me. Thank you for sharing!