Moving files to PC with appropriate extensions

I have a bunch of files in a hierarchy of folders which I created with an old version of an application. I am now forced to use a newer version which only runs on Windows. The Mac application didn’t bother with extensions, but Windows does. It would make life easier when I move them over to the Windows box if I could add the needed extension to the files. I would like to search through the folders looking for examples of a file type (in this case “SHA3”) and add the extension “.MSD” to end of the file name.

This is probably a common problem for people who are forced to use both Mac and Windows. Anybody have a script which will do something like this or can someone offer me some help?

Thanks
nick

Do you want to add the extension based on file type or creator type? If creator type, this might be close to what you need. Beware: I don’t know how well it will handle a folder with hundreds of files. Finder might choke and require a different approach.

set target_fol to (choose folder with prompt "Choose a folder.")

tell application "Finder"
	set files_ to files of entire contents of target_fol whose creator type is "SHA3"
	set count_ to count files_
	repeat with i from 1 to count_
		try
			set name of item i of files_ to (name of item i of files_ & ".MSD")
		on error e
			display dialog e buttons {"OK"} default button 1 with icon 0
		end try
	end repeat
end tell

– Rob

Seems to work on a small scale. Haven’t tried it on a large scale yet. The reason for going for File Type instead of Creator Type is the not all files created by the application require the same extension when transferred over to Windows. I.e. a given Creator Type creates more than one File Type so adding the extension based on File Type would be better.

BTW, I am using ResEdit to find the Creator and File type. Is there an OS X utility that will do this?

I use excellent and free MuchoFileInfo.

Jon

I did some testing (in OS X 10.2.8) and it appears that the Finder and Standard Additions (info for) are not reliable when retrieving file and creator types. Where File Buddy provides the correct info, Finder and ‘info for’ sporadically return ‘missing value’. Based on these results, if I needed to do something similar to what you need to do, I would likely look for a capable, scriptable utility or one that can handle the task and work on batches of files. :confused:

– Rob