Hello,
Think I've solved this problem by copying the way the CMS package implements the same thing.
The index page for the CMS does not seem to use a 'master' template. It just defined the frameset and loads the correct frame by calling a tcl script directly. I just put the tcl that gets the links into that script and added the script name to the src parameter of the appropriate frame tag.
I wouldn't have thought you could call a tcl script from a <frame> tag.