Hi,
My guess is that the script can't find the file you want to open, not that it can't find structapps.fm. One question... what is this?
var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
Did you define this yourself? Have you tested 'filename' after the call? Try something like this afterwards to see what FrameMaker is actually trying to open:
alert(filename);
Russ