lunes, julio 13, 2015

MacOSX Preview Exception after Microsoft Office 2011 uninstall

As many users out there I had the need to move my entire work to MacOSX over time. I've been a Mac Fan since early '90s with limited access to some of the best Apple's Hardware that we've seen.
Unfortunately that golden age is gone and we ended up with a good operating systems but with some security, privacy and operational issues as we move forward.
Last week I decided to remove my old Microsoft Office 2011 package from my laptop and as you can imagine is not that easy. There are several steps that go from remove Microsoft Office 2011 office folder from your app directory (easy part) to manually remove .plist and fonts directories from your library profile.
I've found this process extremely tedious but at the end after a few minutes I've accomplished my task, Office Suite has been completely removed from OS X.
After a few hours I received an email with a PDF file and I proceed to open it with the Mac OS X standard app "Preview" but as soon as I tried to do it I get an exception message with the following information:

"Application Specific Information:*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderSet initWithObjects:count:]: attempt to insert nil object from objects[0]'terminating with uncaught exception of type NSException"

I thought that was something related to that PDF file only, but after doing some research I realized that this was something even bigger than just a corrupted PDF file, Preview was not working at all.
I've went through a ton of different forums, even Apple support community recommended pointless steps to fix this issue but at the end I found that was an issue with my Fonts library caused by the uninstall process of Microsoft Office.
In order to fix this problem I tried to run the built-in health check tool from Font Book but was useless, so after make some research I came up with a workaround.

1) Download Microsoft Office 2011 .dmg image.
2) Install Pacifist Shareware application that opens Mac OS X .pkg package files, .dmg disk images, and .zip, .tar, .tar.gz, .tar.bz2, and .xar archives and allows you to extract individual files and folders out of them.
3) Open Pacifist, browse your Office 2011 .dmg file and open the image.
4) Look for the core components and within that section select the "All Fonts" package.
5) Click Install.

Once you have installed the fonts main package you should be able to open Preview again.

Just some additional comments, I've found that this particular exception may be caused not only for a wrong Office 2011 uninstall process but for some inconsistency with your fonts library or even a PDF corrupted file that stayed resident in memory. Please keep that in mind before proceeding with the remediation process and always have a snapshot from your time machine or a complete backup from your key files.