Home Forums eaDocX queries Scripting example in JScript?

Home Forums eaDocX queries Scripting example in JScript?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #7498
    Ken Norcross

    Does anyone have a JScript example of the eaDocX scripting feature?

    I started looking at this today, in particular the Table_with_Styles vbscript example.

    I know enough JScript to do scripting in Sparx, but I don’t know anything about vbscript, and it is not obvious to me how to translate some of this.

    For example, the vbscript mentions 4 arguments to the script, but I do not see any declaration of the arguments in the function signature, and I am not sure if this is normal for vbscript or that the “arguments” are really some kind of global like the Sparx object “Repository”.

    Also it is not clear to me in the vbscript how the value is returned. It ends with the odd statement of assigning the return string value to the function name.

    I think if I could understand how to create the right format/signature for the entry, and how to return the result, I can figure out the middle bits of creating the html.

    If anyone has a JScript example it would be appreciated.

    If I get this working I will post my sample for others.

    Ken Norcross

    I have cut my attempt down to the simplest script we could run but calls to JScript seem to fail.

    !INC Local Scripts.EAConstants-JScript

    * Script Name:
    * Author:
    * Purpose:
    * Date:

    function APITestJScript() {
    return “Hello”;


    The error message is:

    Syste.Runtime.InteroptServices.COMException (0x800A03F7): Unterminated string constant
    at MSScriptControl.ScriptControlClass.AddCode(String code)
    at eaDocXAddIn.EAScript.runUsing(Repository Repository, String ElementType, String ElementGuid, String HeadingLevel, String Param1, String Param2, String Param3)

    Ken Norcross

    Anyone have any luck with a JScript script called from eaDocX?

    I do not believe there is any unterminated string in this very simple test script, so I have to think the error is elsewhere.

    I have a large library of Sparx scripts written in JScript, so I would hate to have to start over with a new language (VBScript) that I have no experience with.

    Ken Norcross

    Just checking again, anyone have any luck getting the eaDocX scripting feature working with JScript?

    I have a document formatting requirement I know I could easily solve with a script, that I cannot think of how to solve otherwise (at least yet), so has anyone had any luck with JScript?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Compare licence prices

Choose the licence that’s right for you and your team


Download a free trial

Download eaTeamWorks today for several free for life features, plus no obligation, 30-day trials of all the products: eaDocX, ea Revision Manager, eaSheets, Model Expert and PortfolioManager. Discover for yourself why we sell the world’s best-selling Enterprise Architect extension.