Newbie Help - changing text order in a variable?

Hi!

Great product!

Newbie help appreciated

I have several files with filenames from a voice recorder that I wish to rename

Initial filename (it is based on a datestamp) is: 160531_001.MP3

I need to change this to ab_310516.MP3

Detailed help/comments greatly appreciated.

Thanks

Mik

Hi Mik! Always nice to see newbies here.

Is it always "ab" or is this supposed to represent some derived value?

I'm guessing the "001" is a sequence number - do you ever have more than just "001" for the same date?

Hi Dan

Thanks for the welcome!

  1. It is always ‘ab’.

  2. The ‘001’ sequence number is not required.

Basically I am changing the date around to match the UK order of yymmdd to ddmmyy - all other characters are ‘fixed’

Mik

OK, here's the logic for changing the name:

Test.kmmacros (2.8 KB)

It uses a RegEx to split the name up into its parts. If you don't know Regex, let me know and I'll break it down for you. Or if you're really adventurous, you cold do some Googling and see what you can figure out. Search for "regex" and go from there. Learning Regex is extremely valuable, if not head-scratching. :slight_smile:

Then we just re-assemble the parts.

How were you envisioning using this? Select a file or files and execute the macro to rename it/them?

By the way, if you regularly do a lot of bulk file renaming, "A Better Finder Rename" is awesome. http://www.publicspace.net/ABetterFinderRename/ If you had it, we'd be almost done.

But KM can certainly do the rest of the work, and you've already got that, so...

As I said, look this over and we'll go from there.

1 Like

Dan - thank you SOOOOO much

That is amazing!

Exactly what I wanted.

Basically I detect when the voice recorder is plugged in via USB. I find the latest file,copy it over to the mac, rename it and then open it in Adobe Audition for some simple editing.

Thank you soon much

Mik

Awesome! Let me know if you need more help.

You might find this macro helpful:

Batch Rename files in the Finder