Welcome Guest

Pages: 1 2
Simple rename file/folder question
deadman36gPostJuly 15, 2016, 13:36
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicSimple rename file/folder question

Sorry for the sudden surplus of what are most likely simple solution questions, BUT...

I am trying to rename my stuff the following way (for example)

Aerosmith/(1973) Aerosmith/01 - Make It

My problem seems to be creating more than one folder I was able to get

(1973) Aerosmith/01 - Make It using

❨Title❩
❨IfDup❩
    ·(❨Dup #❩)

❨Folder Start❩

(❨Year❩)❨Album❩

I tried

❨Title❩
❨IfDup❩
    ·(❨Dup #❩)

❨Folder Start❩

❨Album Artist❩(❨Year❩)❨Album❩

and

❨Title❩
❨IfDup❩
    ·(❨Dup #❩)

❨Folder Start❩

❨Album Artist❩/(❨Year❩)❨Album❩

so I figure I am missing something simple

Also can I can control where the renamed folders/files end up using this method or have YATE simply rename and move the current folder?

The old program I used would create new folders and thus leave behind any .nfo,.jpg,.cue, etc. files.

2MR2PostJuly 15, 2016, 14:14
Avatar photo
Administrator
Posts: 2087
Registered:
August 23, 2012, 19:27
Normal topicRe: Simple rename file/folder question

You cannot use rename to modify any folder other than the parent folder. The correct way to do it is with a move, a rename and by moving the non audio files.

Try the following in an action: CAREFUL ABOUT READING THIS IN THE EMAIL NOTIFICATION AS THE MAILER STRIPS THE ESCAPE CHARACTERS!

1) Set Variable 1 to "\u"
2) Move to /{root}/Album Artist/<(Year) Album/Variable 1>
3) Rename Files (Title)
4) Move all non audio files using original and current folders (delete original and parent folder if empty)

1) sets Variable 1 to a unique identifier. The Move statement cannot handle duplicates as does the rename statement.
2) does the move. Replace /{root} with your actual root folder or change the move to be relative. Make sure (Album Artist) is consistent. The <(Year) Album/Variable 1> rename template simply renames the file to the UUID (which is guaranteed to be unique). It also adds a path component for the album level. The Move statement can effectively create 4 metadata constructed folders. 3 specified inline and 1 from the rename template.
3) Renames the files (not folders! Do not include a Folder Start). Use whatever rename template you wish but it should handle duplicates.
4) Moves all non audio files which were left behind. You can edit this statement to move all (as above), or to include/exclude files. The statement also deletes the containing folder and its parent if empty.

The '(Year) Album/Variable 1' rename template is:

❨Variable 1❩ ❨Folder Start❩ (❨Year❩)·❨Album❩

My 'Title' rename template is:

❨Title❩ ❨IfDup❩·(❨Dup #❩)

deadman36gPostJuly 15, 2016, 14:44
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicRe: Simple rename file/folder question

Ok, I think I am getting somewhere now

for path I have [Album Artist]/(\[Year]) \[Album], is there is way so that I can replace text in this?

For example an album titled

Year: One is being moved to Year/ One

the : is being replace by a /

I would like to change it so that the : is replaced by a space

2MR2PostJuly 15, 2016, 15:12
Avatar photo
Administrator
Posts: 2087
Registered:
August 23, 2012, 19:27
Normal topicRe: Simple rename file/folder question

Ahh, naughty, naughty. If you'd have gone down my route it wouldn't have happened. Rename always replaces : and / characters with the Preferences-General-Invalid Character sequence.

Intentionally the Move does not replace / characters in the path as that gives you the ability to construct additional path components. However, in what is somewhat of a bug, I'm not replacing the : characters. Apple is changing : to slash-space. I will put in code to change : characters to the invalid character field.....however, I will not replace / characters as it is a useful capability.

If your base path includes metadata, you could have a / at any time in the Title or any other field. This will result in an additional folder level you do not want. I suggest not putting the metadata on the base path and going down the road I outlined in the previous answer.

I've attached the Move statement with a bogus base path.
Image

deadman36gPostJuly 15, 2016, 15:48
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicRe: Simple rename file/folder question

Ok, I am trying but I am missing something here is some screenshots to help explain what I am doing

Ok first here are my move settings
Image

Next these are the complete steps to the action I am trying to create
Image

Here are the rename settings used in the action
Image
Image

And here is my variable setting

Image

But I got the error

New filename is empty

So I tried this,

I removed ❨Variable 1❩ from the ''(Year) Album/Variable 1' rename template, and that did do what I was expecting. The only thing is it could create problems down the road I am guessing

2MR2PostJuly 15, 2016, 16:13
Avatar photo
Administrator
Posts: 2087
Registered:
August 23, 2012, 19:27
Normal topicRe: Simple rename file/folder question

You've set a system variable in preferences....not a per file variable. System variables are 10 for the entire application. Standard variables are 10 per audio file.

You did not put statement #1 into the action. You omitted the following statement:

Set Variable 1 to "\u"'

Also, the (Year) Album/Variable 1 statement should be restored and there are some extraneous spaces in the template.

My, fault I'm working on the next update to Yate and I was too lazy to go to my 'release' Mac. I've now done so 🙂

I've uploaded a file contains a DeadmanMove action and the used templates to:

https://2manyrobots.com/actions/DeadmanMove.zip

Unzip the file and do a Yate>Import Preferences (with Overwrite as the conflict mode) on the DeadmanMove.plist file. You will have the DeadmanMove action. Take a look...it should make sense. I've used \h as a replacement for your Home folder so that I could test.

BTW: I've fixed the : in a constructed path bug.

deadman36gPostJuly 15, 2016, 16:35
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicRe: Simple rename file/folder question

Thanks 2mR2 you are incredible. After trying nearly a dozen different tag editors for OS X I think I have found the last one I will ever need 🙂

deadman36gPostSeptember 14, 2016, 19:55
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicRe: Simple rename file/folder question

Hello again, I am trying to make an edit to the script you provided me but again am running into issues.

What I am wanting, is, if the files have a disc number assigned to them, I want them in subfolders with the disc number

ie. Aerosmith/This Rocks (2016)/
Disc 01/
Disc 02/
etc.

I want the number padded as shown, and I would like the script to skip albums where there is only one disc,

2MR2PostSeptember 14, 2016, 20:13
Avatar photo
Administrator
Posts: 2087
Registered:
August 23, 2012, 19:27
Normal topicRe: Simple rename file/folder question

Let me get this straight 🙂 Before you wanted (year) Album

now you want: Album (year) ... and you want the disc subfolders.

If there is only one disc, i.e. all disc 0 (empty) or 1, Do not move at all? Just leave the tracks where they are?

.. or are the artist and album folders already in place and you want only want the disc subfolders created relative to where they currently are??? i.e.. you're correcting.

Either way or combination is okay by me.

deadman36gPostSeptember 15, 2016, 11:24
Newbie
Posts: 9
Registered:
July 14, 2016, 01:21
Normal topicRe: Simple rename file/folder question

sorry, let me try to be more clear.

Yes, if there is only one disc (empty or all disc 1) keep the current renaming scheme you already made for me.

2nd, I manually did this for what I currently have, so just new additions would be fine,

Pages: 1 2
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.041 seconds.