Trim first 6 characters from Folder Names [AppleScript]


I've found an AppleScript online which trims the first characters from a FILENAME, however, it does not seem to work on FOLDERS.

How could this be modified to rename folder names?

set whichFile to choose file with multiple selections allowed
repeat with aFile in whichFile
    tell application "Finder"
        set filename to name of aFile
        set name of aFile to ((characters 7 thru -1 of filename) as string)
    end tell
end repeat

Thank You!

Best Answer

It's easy to trim the first six characters using Namechanger.

I apologize if you specifically need to use AppleScript, but Namechanger is a useful app for renaming files & folders. It has treated me well.

I hope this helps!