doc.Import of xml tables no longer working
Hi All,
I've got an extendscript app that has worked fine for years in FM 2017, but it's stopped working.
It gets as far as cutting the table>
SelectElement(doc, para);
var textRange = new TextRange;
textRange.beg.obj = textRange.end.obj = para;
textRange.beg.offset = 0;
textRange.end.offset = Constants.FV_OBJ_END_OFFSET;
doc.TextSelection = textRange;
textRange = doc.TextSelection;
var pgf = doc.TextSelection.beg.obj;
var start = pgf.Start;
SelectElement(doc, table);
doc.Cut(0);
This works fine. But then this next bit is no longer working.
var importParams = GetImportDefaultParams();
i=GetPropIndex(importParams,Constants.FS_ImportAsType);
importParams[i].propVal.ival=Constants.FV_TYPE_XML;
i=GetPropIndex(importParams,Constants.FS_FileIsXmlDoc);
importParams[i].propVal.ival=Constants.FV_DoOK;
i=GetPropIndex(importParams,Constants.FS_AlertUserAboutFailure);
importParams[i].propVal.ival=0;
i=GetPropIndex(importParams,Constants.FS_DontNotifyAPIClients);
importParams[i].propVal.ival=1;
i=GetPropIndex(importParams,Constants.FS_HowToImport);
importParams[i].propVal.ival=Constants.FV_DoByCopy;
var returnParams = new PropVals() ;
//add notification for user response to trigger set_shading
Notification(Constants.FA_Note_BackToUser, true);
doc.Import (doc.TextSelection.end , filename, importParams, returnParams);
// reapply para page next properties
pgf.Start = start;
The filename variable exists and is a valid xml file for import.
I get no failure alert, just nothing happens, no file imported.
I'm a bit rusty so would appreciate any pointers on potential issues and best way forward on trouble-shooting?
Thank you!
