How to find or truncate filenames > 36 characters in a directory?


Recommended Posts

I have some video files to transfer to my Portable Media Player. Unfortunately due to a bug with the player, it doesn't recognise files with filenames that are greater than 36 characters.

I need a list of files that are > 36 characters so that I can find them and rename them manually, or to truncate the names automatically (looking within a certain directory of course). I am open to using the Terminal, Applescript or a utility.

I have been looking online at things like using RegEx with grep, but I can't seem to work out how to do it for finding strings which are > a certain amount of characters.

Thanks for help with this.

Link to comment
Share on other sites

Hi,

i just made a script for you.

the only thing you have to do is to select the folder an run the script. the script then scans the folder, looking for files whose filename is > 36 characters. If that's the case, it automatically shortens the filename to 30 characters plus the extension. it also tells textedit to make a new document, telling you which files had been renamed and what their filename was in the first place.

don't look at the code though, i bet there is a much easier way to do this.

i hope this works for you, i've never written a script for somebody else except for me.

if you want something changed, just pm me.

greets from germany

carcha

RenameScript.zip

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.