Skip to main content
Participant
Aug 5, 2022 7:36 PM UTC
Question

script save file without backup

I just want to share with the community the scripts that I have made
When you save a document a backup is created automatically, this script allows you to save without framemaker creating the backup

function saveFile(file) {
    retProps = new PropVals();
    saveProps = GetSaveDefaultParams();
    var index = GetPropIndex(saveProps, Constants.FS_AutoBackupOnSave);
    saveProps[index].propVal.ival = Constants.FV_SaveNoAutoBackup;
    file.Save(file.Name, saveProps, retProps);
}

var file = File("C:\\Users\\USUARIO\\Documents\\framemakerfile.fm");
saveFile(file);

 

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Fightergator
Inspiring
Aug 8, 2022 9:28 PM UTC

Thanks for the piece of code.  I'll add it to my collection.  I can see where this would be useful in some of the work I do. 

Translate
Bob_Niland
Community Expert
Community Expert
Aug 6, 2022 2:26 AM UTC

With .backup.fm files, isn't the ‘problem’ that FM creates the backup copy on Open, or if it already exists, overwrites it on Open?

Translate
Participant
Aug 6, 2022 2:13 PM UTC
when open the .lock file is created, on save the .backup file is created
Translate