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

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

Explorer ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

465

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
Community Expert ,
Feb 11, 2020 Feb 11, 2020

Copy link to clipboard

Copied

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);

Votes

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
Explorer ,
Feb 12, 2020 Feb 12, 2020

Copy link to clipboard

Copied

LATEST

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

 

Votes

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