Rewrote everything I wrote yesterday from scratch. Fixed it and made very clean and robust. Now it's possible to link a TIM file to multiple tactics. Only showing those TIMs that are in open projects, keeping those that are in closed projects but not deleted.