• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Saving to distinct MIF version not possible in script

Community Expert ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

In the following script MIF is saved in the version of the current FM. For example, if FM-16 (2020) is active, then the script save as MIF-16.

 

KLD_Z.SaveDocToMif = function (oDoc, saveName) { // ===========================
/*            Save document to MIF at the same location as the original document
Arguments     oDoc            Document to be saved
              saveName        File name e.g. oDoc.Name + ".mif"
Reference     Rick Quatro in 
              https://community.adobe.com/t5/framemaker-discussions/
              creation-of-extra-dialogue-in-framemaker-for-templates/td-p/13664579
*/
var params, returnParams, j;                                  //  1
                                                              //  2
  params = GetSaveDefaultParams ();                           //  3
  returnParams = new PropVals ();                             //  4
  j = GetPropIndex (params, Constants.FS_FileType);           //  5
  params[j].propVal.ival = Constants.FV_SaveFmtInterchange;   //  6
                                                              //  7
  oDoc.Save (saveName, params, returnParams);                 //  8
  if (FA_errno === 0) {                                       //  9
    return saveName;                                          // 10
  } else {                                                    // 11
    PrintSaveStatus (returnParams);                           // 12
  }                                                           // 13
} // --- end SaveDocToMif -----------------------------------------------------

 

However, I wanted to save as a distinct MIF version (say, MIF-14) out of FM-16.

For this purpose I changed in line 6 FV_SaveFmtInterchange to FV_SaveFmtInterchange140

This does however, not save at all (line 8). It results in reporting SaveStatus as FV_BadSaveScriptValue.

► How to save as a distinct MIF version similar to save as distinct FM-version?

TOPICS
Scripting

Views

152

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 28, 2023 Mar 28, 2023

I think I encountered this before, but I am trying to remember the circumstances. Fortunately, the MIF parsers are forwards-compatibile, so in practice it shouldn't make any difference.

Votes

Translate

Translate
Community Expert ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

Can you save to MIF 7?
That's the only back version that matters (due to FM1-7 not supporting Unicode).
FM8-202x would be expected to be able to open any version of MIF.

 

And as an aside, saving to MIF7 probably only assures that FM1-7 will be able to open the file. There is no way that the save-back-as-MIF can do much about any Unicode in the original FM8+ document, other than what FM uses internally.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

I did not test the save to MIF-7. But I have the impression that the current behavior is intended by the developers. If the MIF always has the 'highest level of content' - it serves more situations than when it is 'downgraded' to a praticular level (as we can do with FM save).

My question then is, what purpose the constants such as SaveFmtInterchange140 have. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

LATEST

I think I encountered this before, but I am trying to remember the circumstances. Fortunately, the MIF parsers are forwards-compatibile, so in practice it shouldn't make any difference.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines