add script to build idx files