Converting files for double-click in Office 2008

In the Service release 1 for Office 2008, Microsoft decided to prevent files with old file types to open through a double-click or a drag and drop (and don’t know why and that’s not the point here).
There is a workaround to open these files. MS recommends that you use the Open dialog from within Office applications.
If you have hundreds of old files affected with this problem, that’s hardly a decent solution.

You can batch-wipe out the creator code of your files as well. If you do so, the Finder will then exclusively rely on the extension of the file (eg: .doc, .xls…). That works well… unless you are missing extensions on some of your files.

I’ve been considering a much better approach: correct the file types according to what they are now actually supposed to be.
I wrote a simple AppleScript for that, but I need feeback:

  • I know what outdated file types are now blocked by Office for Word and Excel, but not for PowerPoint.
  • I need people to test the script and report back in case there is a problem (test on a copy of your files of course!).

Here is the script:

on open TheFiles
     repeat with OneFile in TheFiles
          tell application "Finder"
               -- get the file type
               set TheFileType to file type of OneFile
               -- detect old file types for Office files chose the correct one instead
               if TheFileType = "WDBN" then set UpdatedFileType to "W8BN"
               if TheFileType = "XLS4" then set UpdatedFileType to "XLS8"
               --     if TheFileType = "SLD8" then set UpdatedFileType to "SLD8"
               -- set the new file type
               set file type of OneFile to UpdatedFileType
          end tell
     end repeat
end open
-- warning in case the application is not use as drag and drop
on run
     display dialog "Drop your files to be converted on this icon"
end run

You need to compile it as an application and drag your files on its icon.
You can download the compiled (yet editable) version here.