MacResource
How do you add file extensions to a bunch of files at once? - Printable Version

+- MacResource (https://forums.macresource.com)
+-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1)
+--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3)
+--- Thread: How do you add file extensions to a bunch of files at once? (/showthread.php?tid=127929)

Pages: 1 2 3


Re: How do you add file extensions to a bunch of files at once? - Chakravartin - 12-01-2011

Oh!

And this script will rename every item in a folder.

set the_folder to (choose folder)

tell application
Finder
set the_files to (every item of the_folder)
repeat with i from 1 to (count of the_files)
set the_name to (name of (item i of the_files))
if the_name does not end with
.txt
then
set name of (item i of the_files) to the_name &
.txt
end if
end repeat

end tell



Re: How do you add file extensions to a bunch of files at once? - RAMd®d - 12-01-2011

Do I really have to spend $20 to do this?

Nope.


http://www.macupdate.com/app/mac/33659/rename


Re: How do you add file extensions to a bunch of files at once? - Panopticon - 12-01-2011

decay wrote:
R-Name

Intel Version:
http://movieconverter.online.fr/DL/R-NameUB.zip

(tu) (tu) (tu) (tu) (tu)
Another vote for R-Name, been using it for years w/o a hitch.


Re: How do you add file extensions to a bunch of files at once? - john-o - 12-02-2011

Thanks once again everyone! Great stuff!!

I delivered the client's backup back to them today, but I'll have them email me a couple of those files to try your scripts on, Chakravartin. I doubt they still have type and creator codes anymore, but it's worth a try.

The weird thing was that within every folder of these old docs were both a "FINDER.DAT" file and a "RESOURCE_FRK" folder, which was full of what I assume were the actual resource forks of each document (they all had weird truncated names and showed up as "Unix executables" as well).

I seem to remember reading somewhere years ago that copying files to a drive that wasn't formatted correctly could end up stripping the resource forks out of the files, but I don't remember details...

Technology. Ugh...