10.4: Another fix for non-launching PowerPC apps on Intel

Aug 08, '06 07:30:00AM

Contributed by: strikeman

The problem: Some PowerPC applications (such as Word) sometimes fail to launch on Intel Macs.

Level 1 solution: There is a root process called translated which seems to be launched with PowerPC programs. If this process is killed, then the application can be launched with no troubles. Note that an administrator password is required. translated can be found by opening up the Activity Monitor. Select the process and click on Quit Process. This was covered in this recent hint.

This solution works, but it is a pain. Read on for some alternative solutions...

Level 2 solution: Automate the termination of the translated process. I wrote an AppleScript program which kills translated and launches Word. The first complication -- translated is not AppleScriptable, so you can't just tell it to quit. The following script uses some Unix shenanigans to find the process id of translated, and then a quit signal is sent to it, before Word is launched.

set pid to do shell script ¬
 "ps -auxw -U root | grep -i translated | awk '{print $2}'"
if pid ≠ "" then
  do shell script "kill -TERM " & pid ¬
   with administrator privileges and password
end if
tell application "Microsoft Word" to launch
This solution is better, but what if you want to launch Word with a Word document?

Level 3 solution: Add a run handler. The following script quits translated, whether you are just launching Word or opening a document.
on run
  killtranslated()
  tell application "Microsoft Word" to launch
end run

on open wordfiles
  killtranslated()
  repeat with afile in wordfiles
    try
      tell application "Microsoft Word" to open afile
    end try
  end repeat
end open

on killtranslated()
  set pid to do shell script ¬
   "ps -auxw -U root | grep -i translated | awk '{print $2}'"
  if pid ≠ "" then
    do shell script "kill -TERM " & pid ¬
     with administrator privileges and password
  end if
end killtranslated
Save the AppleScript as an droplet (I call it WordLauncher), and if you drop a Word document onto the droplet, it will launch Word and open your document with no problems. The obvious next step is to just allow us to double click Word documents.

Level 4 solution: Let WordLauncher hijack all Word document launches. Usually we could just use Finder's Get Info on a Word document, 'Open with:' WordLauncher, and choose Change All. However, it seems that Script Editor doesn't do all the bundle work that is required. I won't go into the gory details, but essentially I had to add a CFBundleDocumentType for Word documents (I chose to associate W8BN and W6BN).

Bonus step -- add a Word document icns to WordLauncher so Word docs still look like they should.

[robg adds: I haven't tested this one.]

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2006080308222881