Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Error while loading an XML document using a structured application

$
0
0

Hi,

 

I try to load an XML document using a structured application defined in the default structapps.fm

 

My code is shown down, extracted from the FDK API code sample.

 

Problem, I always have the same message :

"Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "

 

Where "e:\xml\AdobeFrameMaker10\" is my install directory.

So I assume that frame try to find the structapps.fm file but does not find it.

What else can it be ?

 

Does anyone knowns how to achieve this simple task using extendScript ?

 

Thanks for any comments, Pierre

 

 

 

function openXMLFile(myLastFile) {

    var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);

    if (filename != null) {

       

 

        /* Get default open properties. Return if it can’t be allocated. */

        var params = GetOpenDefaultParams();

       

       

        /* Set properties to open an XML document*/

       

        /*Specify XML as file type to open*/

        var i = GetPropIndex(params, Constants.FS_OpenAsType)

        params[i].propVal.ival = Constants.FV_TYPE_XML;

       

       

        /* Specify the XML application to be used when opening the document.*/

        i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)

        params[i].propVal.sval = "myApp";

       

       

        i = GetPropIndex(params, Constants.FS_FileIsOldVersion)

       

        params[i].propVal.ival = Constants.FV_DoOK

       

        i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)

       

        params[i].propVal.ival = Constants.FV_DoOK

       

        i = GetPropIndex(params, Constants.FS_FileIsInUse)

       

        params[i].propVal.ival = Constants.FV_DoCancel

       

        i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)

       

        params[i].propVal.ival = Constants.FV_DoCancel

       

        /*The structapps.fm file containing the specified application must have

        already been read. The default structapps.fm file is read when FrameMaker is

        opened so this shouldn't be a problem if the application to be used is

        listed in the structapps.fm file.*/

       

        var retParm = new PropVals()

        var fileObj = Open(filename, params, retParm);

        return fileObj

    } else {

        return null;

    }

}


Viewing all articles
Browse latest Browse all 3715

Trending Articles