Skip to main content
JonBe
Inspiring
September 21, 2020
Question

ScriptingSupport client does not return an error if the supplied script does not exist

  • September 21, 2020
  • 1 reply
  • 251 views

I found this little gotcha when converting plugins from 20-17 to 2019 for a client. The call to the ScriptingSupport client does not return any error indication if the script file does not exist. This took longer than it should have to resolve. If the call had returned an error, say FE_NameNotFound, the problem would have been immediately obvious. I have created a bug, which you may care to vote for, which includes code to illustrate the problem.

https://tracker.adobe.com/#/view/FRMAKER-9298

 

This is the output written to the console for the test code. The second script does not exist and ScriptingSupport returns no indication of this. Note that FA_errorno will only have non zero values if F_ApiCallClient itself has problem. It is up to ScriptingSupport (FrameMakerScriptingSupport.dll) to return other than zero if a problem occurs, or the return value from the script, if one is provided.

adobetestscript1.jsx returned 100

FA_errorno = 0

adobetestscript2.jsx returned 0

FA_errorno = 0

This topic has been closed for replies.

1 reply

Participating Frequently
October 6, 2020

It may not help in this situation, but you can use notifications and ReturnValue on the extendscript side to communicate between extendscript and your FDK client.

 

Its a bit more setup, but gives much more control than just saying "run this script if it exists".

JonBe
JonBeAuthor
Inspiring
October 6, 2020

Thanks Dan,

 

I am already return values in extendscripts. I cannot envisage, in a commercial environment at least, where you wouldn't want to know if the script succeeded or had an error. This is the annoying thing about this bug; having the scripting support client returning 0, usually means everything was okay. 

I use notifications from Extendscripts to access plugin functions.


As you surmised, returning values or notifications do not help in this case, as the script is never processed.

 

Jon