Thursday, June 16, 2011

Dealing with Help Viewer cache

It is pain in the neck to deal with Help Viewer cache when developing your Help documents. After updating your indexes with Help Indexer, you may find Help Viewer refusing to open your Help Documents, links do not work, or show empty pages. This happens because more often than not the version number of your help document in the plist is not bumped up.

To fix this problem, I wrote the following bash script to clear several cache repositories Help Viewer and Help Indexer is using.

Create a text file using the text editor pico from the command line:

pico ./hvfix


Edit your text file, then save on exit:

rm -rf ~/Library/Caches/com.apple.help*
rm -rf ~/Library/Preferences/com.apple.help*
rm -rf ~/.Trash/*
killall helpd
defaults write com.apple.helpindexer IndexAnchors YES


Before you run the script make sure to give executable permissions to your script like this

chmod +x hvfix
./hvfix


Then run your script:

./hvfix


This script also automatically sets "Index anchor information in all files" checkbox (which is normally needed for anchor indexing) before you run the Help Indexer next time.

iTerm2 - How to auto-close sessions and auto-exit when last one closed

 Problem There are two problems when you close sessions and windows in ITerm2. When you gracefully exit from ITerm2 sessions with a recommen...