Audio Extension-o-Matic

I got a call today from a producer with a bunch of audio files that wouldn't open. Because he'd made the files in Mac OS 9, I suspected they didn't have filename extensions. So I sent him this little drag-and-drop application I'd made with AppleScript when I ran into a similar situation.
Simply copy and paste the code below into Script Editor, save it as an application, and drag some files onto the icon to add the ".aif" extension.
I considered making a fancier version that lets you specify what extension you want to add, but the "Add to File Names" script that comes with OS X already does that. This one's so drag-and-drop easy I just leave it on my desktop, where it joins Deep Niner's Xtract2Wav44 anything-to-WAV converter and Doug Adams' Drop a Few My Way anything-to-MP3 converter.
on open draggedItems
tell application "Finder"
repeat with eachFile in draggedItems
if the name of eachFile does not contain "." then
set fName to (name of (info for eachFile)) & ".aif"
set name of eachFile to fName
end if
end repeat
end tell
end open
on run
display dialog "Drag and drop some files onto this icon to add an \".aif\" suffix." buttons {"Whatever"} default button 1
end run
What audio shortcuts are you using?
Categories
AudioComments (1)
Read More Entries by David Battino.

Unfortunately, I do not know AppleScript, so I don't know the answer. Is there a way to obtain file properties within AppleScript? If so, a universal script would be helpful to append extensions for any file format.