- Joined
- Nov 18, 2015
- Messages
- 1
- Reaction score
- 0
- Points
- 1
Hi everyone
I really hope someone can help me, I’ve been going around in circles on this. I’d like to rename all the album name metadata in my music collection, setting it to the parent folder name. The iteration that I think is needed is:
for each folder
* for each file
* store folder name as string
* set file metadata = subfolder string
* end
end
So far I've managed to iterate through subfolders, but just accessing the files of the folder is where I'm stuck. Because I have album year often prefixing the album name, I get an error because it thinks it's an integer. (after this I'll still need to change that filename's metadata, which I'm not at all sure of either)...*
on run
* set ArtistFolder to (choose folder with prompt "Select the start folder")
* RenameMetadata(ArtistFolder)
end run
on RenameMetadata(aFolder)
* tell application "Finder"
* set subFolders to every folder of aFolder
* repeat with eachFolder in subFolders
****** my RenameMetadata(eachFolder)
****** set theItems to every file of folder (eachFolder)
* *****repeat with theFile in theItems
*********** set firstString to name of theFile
*********** log FileName
****** end repeat
* end repeat
* end tell
end RenameMetadata
-----------------
best wishes and thanks
paul
I really hope someone can help me, I’ve been going around in circles on this. I’d like to rename all the album name metadata in my music collection, setting it to the parent folder name. The iteration that I think is needed is:
for each folder
* for each file
* store folder name as string
* set file metadata = subfolder string
* end
end
So far I've managed to iterate through subfolders, but just accessing the files of the folder is where I'm stuck. Because I have album year often prefixing the album name, I get an error because it thinks it's an integer. (after this I'll still need to change that filename's metadata, which I'm not at all sure of either)...*
on run
* set ArtistFolder to (choose folder with prompt "Select the start folder")
* RenameMetadata(ArtistFolder)
end run
on RenameMetadata(aFolder)
* tell application "Finder"
* set subFolders to every folder of aFolder
* repeat with eachFolder in subFolders
****** my RenameMetadata(eachFolder)
****** set theItems to every file of folder (eachFolder)
* *****repeat with theFile in theItems
*********** set firstString to name of theFile
*********** log FileName
****** end repeat
* end repeat
* end tell
end RenameMetadata
-----------------
best wishes and thanks
paul