Skip to main content
Jacob_AA
Known Participant
February 21, 2019
Question

avoid references to images and overall xrefs

  • February 21, 2019
  • 3 replies
  • 560 views

How to avoid references to images and overall xrefs during opening dita files with ExtendScript

Is there any parameter for that?

I'm having problem when I open dita files with extendscript in visible mode. but when I copy the file to different path where it doesn't see images and references then it is okey, so I am thinking to avoid references when I open the file.

any thoughts ?

This topic has been closed for replies.

3 replies

Jacob_AA
Jacob_AAAuthor
Known Participant
February 21, 2019

but then I don't see cross references

Jacob_AA
Jacob_AAAuthor
Known Participant
February 21, 2019

I think this:

  i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );

  oaOpenProps.propVal.ival = true;

fixed my issue

thanks

4everJang
Legend
February 21, 2019

I created a function that allows me to open documents in all my scripts easily.

If you want your document to be opened invisibly, just use

var oMyDoc = OpenDoc( sFilename, "invisible" );

when oMyDoc is not null, it is the handle to the opened file.

function OpenDoc( sFilename, sOptions )

{

  var oaOpenProps = GetOpenDefaultParams( );

    if( sOptions != null && sOptions.match( "invisible" ) )

    {

        i = GetPropIndex( oaOpenProps, Constants.FS_MakeVisible );

        oaOpenProps.propVal.ival = Constants.FV_DoCancel;

    }

  i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );

  oaOpenProps.propVal.ival = true;

  i = GetPropIndex( oaOpenProps, Constants.FS_FileIsOldVersion );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_FontNotFoundInCatalog );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_FontNotFoundInDoc );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_RefFileNotFound );

  oaOpenProps.propVal.ival = Constants.FV_AllowAllRefFilesUnFindable;

  i = GetPropIndex( oaOpenProps, Constants.FS_UpdateTextReferences );

  oaOpenProps.propVal.ival = Constants.FV_DoNo;

  i = GetPropIndex( oaOpenProps, Constants.FS_UpdateXRefs );

  oaOpenProps.propVal.ival = Constants.FV_DoNo;

  oaRetParms = new PropVals( );

  oDocOpen = Open( sFilename, oaOpenProps, oaRetParms );

  if( oDocOpen.ObjectValid( ) )

  {

  return oDocOpen;

  }

  else

  {

  return null;

  }

}