Dear all patient helpers,
My current project is 're-furbishing' the FameMaker to EndNote' connection. This task comprises several steps:
- Collect temporary citations (such as [Daube, 1969, #123] ) from text, footnotes and tables into an array. This part already works fine (I had to postpone further development for a year now...).
- Then I write this data to a new document (which is created from the template) - with your help this came to work today.
- This file then is saved as rtf to be worked off by the bibliographic application EndNote (or Citavi in another case) to resolve the temporary citations into formatted citations and the bibliography.
- After that the modified rtf is opened as an FM docment. The information from this is used to replace the temp. citations in the user-document/book by the formatted citations.
- The user then copies the bibliography (as text only) into his appropriate chapter/section and formats it to his liking.
For step 3 I have now researched a lot and found this:
- app.ExportFilters does not provide the list of filters as stated in the FM Scripting Guide.
- For FrameScript Johannes Graubner wrote:
SAVE Document DocObject (docVar) File(ofilename) FileType(SaveFmtFilter) FilterFormatID('RTF'); - Talking about filetype hint strings the FDK Programmers Guide (FDK-PG) informs that format ID would be ‘RTF ‘. But how to use this in eScrpt?
- The Filetype hint string syntax in FDK-PG gives some information, but what vendor code shall be used for RTF?
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc); params = F_ApiGetSaveDefaultParams(); i = F_ApiGetPropIndex(¶ms, FS_FileType); params.val[i].propVal.u.ival = FV_SaveFmtFilter; i = F_ApiGetPropIndex(¶ms, FS_SaveFileTypeHint); params.val[i].propVal.u.sval = F_StrCopyString((StringT)"0001ADBEHTML");
- At another place () Hint strings for the standard installation of filters) FDK-PG states: Microsoft RTF => 0001AW4W0191
- Another information can be found on RTF 1.6 filter hint revealed! : '0001ADBIRTF '
So my interpretation of all this leads to this snippet:
var file = app.ActiveDoc; SaveFileRTF (file); function SaveFileRTF (file) { var params = GetSaveDefaultParams(); var returnParamsp = new PropVals(); var i; i = GetPropIndex (params, Constants.FS_FileType); params[i].propVal.ival = Constants.FV_SaveFmtFilter; i = GetPropIndex (params, FS_SaveFileTypeHint); params[i].propVal.ival = "0001ADBERTF "); file.Save(file.Name, params, returnParamsp); return; }
But alas, this reports a stange error: "Semicolon expected on line 13". Even If you help me to overcome this the next swamp lurks in step 4: how to open the RTF?