I'm looking for a way to replace an existing text-inset in a document with the contents of an other file (by reference), by means of scripting. Say, I have a document c:\referer.fm, in which there is a text inset of which the source file is: c:\A.fm
I also have c:\B.fm, and now I want to change referer.fm so that no longer the text inset holds the text from A.fm, but from B.fm.
I tried this:
var doc = app.ActiveDoc;
var textinset = doc.FirstTiInDoc;
var pathtosource = textinset.TiFile;
pathtosource = "c:\B.fm";
textinset.UpdateTextInset();
But this doesn't work. I guess setting 'pathtosource' cannot be done this way. If anyone knows the way to do this, I would really appreciate your help!
David