Skip to main content
Inspiring
February 11, 2020
Question

In ExtendScript, how do I check the Open() return parameters for failure reasons?

  • February 11, 2020
  • 1 reply
  • 640 views

The ExtendScript documentation lists a variety of flags representing conditions found during an Open(), some that still permit success:

 

  • Constants.FV_ReferencedFilesWerentFound (47) - Imported graphics files could not be found, but the file was opened anyway.
  • Constants.FV_UnresolvedTextInsets(50) - There were unresolved text insets, but the file was opened anyway.
  • Constants.FV_UnresolvedXRefs (49) - There were unresolved cross-references, but the file was opened anyway.

 

and some that result in failure:

 

  • Constants.FV_BadFileName (67) - Specified filename was invalid.
  • Constants.FV_CancelReferencedFilesNotFound (101) - The file contained referenced files that were not available, so the user or the Open() script canceled the Open operation.

 

But I can't find an example of how to check the propVal return parameters from Open(). Are they bitwise flags? Are they indexed ints? I don't understand the mechanics of how propVals work, and the ExtendScript docs seem to assume prior knowledge.

 

Could someone please post an example of how to check for various flags in the Constants.FS_OpenStatus value? Thanks in advance!

 

 - Chris

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
February 11, 2020

Try using this and check the FrameMaker Console for messages:

// Get a property list to return any error messages.
var retParm = new PropVals ();

// ... open code here ...

PrintOpenStatus (retParm);

www.frameexpert.com
Inspiring
February 12, 2020

Thank you! This prints any status messages textually, which is helpful for debugging. How can I test retParm for specific conditions in a script? It's the script processing of retParm that has me stumped.

 

 - Chris