Skip to main content
Participant
May 26, 2015
Question

Failed: Script to save ditamap to FM with ditaval file

  • May 26, 2015
  • 2 replies
  • 435 views

Hi FM scripting Gurus,

I'm stuck in the following issue and need help:

I'm trying to write a script to save ditamaps to composite FM files with ditaval file specified. I use the document property Constants.FS_DitavalFile (=linux.txt) to specify the ditaval file. Unfortunately, it seems that the script does not execute the SaveCompoFm function. If I remove the Constants.FS_DitavalFile property from the function, the script runs properly. I've no idea what the problem is. The following is the SaveCompoFm function. Is there anything wrong with the code? Thanks a lot for your help!

function SaveCompoFm(file,saveName,ditaval)

{

   

    saveProp = GetSaveDefaultParams()

    i = GetPropIndex(saveProp, Constants.FS_FileType)

    saveProp.propVal.ival =Constants.FV_SaveFmtCompositeDoc

   

    i = GetPropIndex(saveProp, Constants.FS_DitavalFile)

    saveProp.propVal.ival =ditaval

    retParm = new PropVals()

    CompoFm=file.Save(saveName,saveProp,retParm);

    return CompoFm;

}

This topic has been closed for replies.

2 replies

frameexpert
Community Expert
Community Expert
May 26, 2015

Is the ditaval file a path to a file? If so, it would be a string property, so instead of ival = ditaval, try sval = ditaval. -Rick

www.frameexpert.com
Participant
May 27, 2015

Hi Rick,

Yes. You are right. I missed the property type. Thanks!

Jeff_Coatsworth
Community Expert
Community Expert
May 26, 2015

Think you were trying to get in here - https://forums.adobe.com/community/framemaker/extendscript?view=overview right?