Highlighted

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

Explorer ,
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

328

Likes

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

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

Explorer ,
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

329

Likes

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
Feb 10, 2020 0
Adobe Community Professional ,
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);

Likes

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
Reply
Loading...
Feb 11, 2020 0
Explorer ,
Feb 12, 2020

Copy link to clipboard

Copied

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

 

Likes

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
Reply
Loading...
Feb 12, 2020 0