10.4: Enable 'Open With for all' to work for certain apps

Nov 04, '05 05:58:00AM

Contributed by: robg

Tiger only hintFellow Macworld employee Jonathan Seff pointed me to the following problem/fix; I haven't experienced it myself, so I can't vouch for the solution at all, though it worked for Jonathan. I thought it was worth sharing, so here it is. Have you ever had the problem where you can't make every file of a certain type open with a particular application? That is, the file type currently opens with the 'wrong' app, so you use Get Info on a file of that type, and change the Open With app setting to the preferred application and click on Change All, only to see the Open With value snap back to the previous app. To those who've been affected, it's quite frustrating. (Note that his wasn't an issue under 10.3, it seems; just in 10.4.) As covered in great detail in this thread on Apple's Discussions board, it seems this isn't Apple's fault. Instead, it appears to be the fault of application you're trying to assign. I'll try to summarize what's in the discussion, but it's worth a visit to the original for additional details if you're having this issue...

These troublesome apps don't have a value set for the CFBundleIdentifier key. If you set one, apparently the problem goes away. So how do you go about fixing this problem? Control-click on the application in question and choose Show Package Contents. Inside the Contents folder, you should see an Info.plist file. You need to open this with the Property List Editor (included with the Xcode Developer Tools) or Plist Edit Pro, or even TextEdit or some other pure-text editor. You then need to add a new key and string to the file:

 <key>CFBundleIdentifier</key>
        <string>com.foo.bar</string>
The first line is easy, as it's always the same. The second line, though, will vary by program. To try to figure out exactly what to put there, take a look in your user's Prefernces folder, and try to find the prefs file for the application in question. If the program you were trying to set up was (completely fictitious data follows) called Sneakers and was written by CoolMacWare, you might find a file called com.coolmacware.sneakers.plist in your Preferences folder. If that were the case, then the second line above would be com.coolmacware.sneakers. It's a bit of a black art, it seems.

After making this change, you need to reset the LaunchServices database. A logout/login should do the trick, or you can try this Terminal command, taken from the Apple Discussions thread:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/\
Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill \
-r -domain system -domain local -domain user
Please note that I have not tested the above command. If everything worked right, you should now be able to use Get Info and reassign the files in question to the previously-non-usable application.

Comments (20)


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