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

Script to open file

Community Beginner ,
Aug 05, 2022 Aug 05, 2022

Copy link to clipboard

Copied

I just want to share with the community scripts that I have created

var propsToOpen = [
    {ask: Constants.FS_AlertUserAboutFailure, select: false},
    {ask: Constants.FS_DisallowMIF, select: false},
    {ask: Constants.FS_DisallowXml, select: false},
    {ask: Constants.FS_FileIsInUse, select: Constants.FV_ResetLockAndContinue},
    {ask: Constants.FS_BookIsInUse, select: Constants.FV_ResetLockAndContinue},
    {ask: Constants.FS_LockCantBeReset, select: Constants.FV_DoOK},
    {ask: Constants.FS_FileIsOldVersion, select: Constants.FV_DoOK},
    {ask: Constants.FS_FontChangedMetric, select: Constants.FV_DoOK},
    {ask: Constants.FS_FontNotFoundInCatalog, select: Constants.FV_DoOK},
    {ask: Constants.FS_FontNotFoundInDoc, select: Constants.FV_DoOK},
    {ask: Constants.FS_LanguageNotAvailable, select: Constants.FV_DoOK},
    {ask: Constants.FS_OpenAsType, select: Constants.FV_AUTORECOGNIZE},
    {ask: Constants.FS_UpdateTextReferences, select: Constants.FV_DoNo},
    {ask: Constants.FS_UpdateXRefs, select: Constants.FV_DoNo},
    {ask: Constants.FS_UseRecoverFile, select: Constants.FV_DoNo},
    {ask: Constants.FS_UseAutoSaveFile, select: Constants.FV_DoNo},
    {ask: Constants.FS_OpenFileNotWritable, select: Constants.FV_DoOK},
    {ask: Constants.FS_RefFileNotFound, select: Constants.FV_DoOK}
];

//Metodo para setear las propiedades y abrir archivo en el framemaker
 function OpenFile(path) {
    props = GetOpenDefaultParams();
    for(var i=0; i < propsToOpen.length; i++)
    {
        var index = GetPropIndex(props, propsToOpen[i].ask);
        if(index > -1)
            props[index].propVal.ival = propsToOpen[i].select;
    }

    var returnp = new PropVals();
    return Open(path, props, returnp);
}

OpenFile("C:\\Users\\USUARIO\\Documents\\framemakerfile.fm");

 

TOPICS
FAQ , Scripting

Views

64

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
no replies

Have something to add?

Join the conversation