I usually get this error when trying to run a script while it's open in ESTK and "Extendscript Toolkit CSx" is by mistake selected as the target application instead of FM.
Regarding Roman's response, you can add this to the top of your scripts to force the ExtendScript Toolkit to use the FrameMaker engine.
BTW, for some reason, when a script is open in ESTK, this line does not change the target app to FM, as if ESTK ignores it.
Rick, Roman: Thank You for answers. However...
The #target instruction has no influence in my environment. As stated in various posts I can not run scripts from the ESTK. ESTK reports a "missing link".
For example in FM-11 I get this error when first opening ESK with File > Scripts > New Script…, then opening the script in ESTK and run it.
I get the same error when trying to do so with FM-12 or FM-13:
Hence I have the script open in my editor (EditPad Pro 7), save it. Then in FM I open the script catalgoue, refresh and run the script.
IMHO the current problem is in the FM-10/11 engine. But I do not undestand the connection between FM ($HOME\ExtendScript.DLL) and C:\Program Files (x86)\Adobe\Adobe Utilities - CS6\ExtendScript Toolkit CS6 (which reports ESTK version 18.104.22.168).
On my wife's mini-PC (small screen, slow) with only 1 FM version installed, I can run scripts with ESTK . But I need to test in various FM versions ...
Probably this ESTK version is to high for FM-10/11 (for the current problem) and I must find means to test with the lower versions (CS5: 22.214.171.124; CS4: 126.96.36.199). Unfortunately I have no success with virtual machines - they are awfully slow on my machine (ThinkPad T400 with docked peripherals). So my test environment may not be clean enough.
I have found the source of the problem:
In OpenTemplate I open an FM12 file - there is no adeaquate error-handling for this
- Having changed the script-ini file to read a MIF-12 file instead, everything is OK
- However this creates a lot of error entries in the console log of FM-10 which will annoy the user.
- Hence I have to provide individual files (versions FM10 ... FMcurrent)
- Better yet, i provide an FM10 version of the template file. This does not create open error thanks to GetTplParams which sets (among others)
j = GetPropIndex(params, Constants.FS_FileIsOldVersion); params[j].propVal.ival = Constants.FV_DoOK;
So my problem is solved! Thanks for listening!