Welcome to ModelRight Sign in | Join | Help
in

Scripting documentation and "hello world"

Last post 07-04-2008, 5:09 PM by gwideman. 2 replies.
Sort Posts: Previous Next
  •  07-04-2008, 4:37 AM 684

    Scripting documentation and "hello world"

    As an experienced programmer, including in VB/VBA, I'm attempting to get some traction on MR scripting, and find myself at a bit of a loss for want of some basic docs, specifically:

    1. An object model for MR. The page "Script Language API Reference", lists the objects and their properties, but since the other objects and collections owned by each object are untyped, there are no clues as to how to navigate the object model. 

    2. Some basic idea of how to produce text output from simple scripts. I ran a script including "Debug.Print" and "[..some setup..] Document.Write", but couldn't figure out where such output goes it.

    (And my hope was that armed with (2), I could use it to crudely explore (1)... but no luck.)

    Are there some docs or examples that elaborate?  Thanks!

    Graham

     

  •  07-04-2008, 5:38 AM 689 in reply to 684

    Re: Scripting documentation and "hello world"

    Admittedly, the scripting documentation is poor.  You can use the Tools/Meta Model Browser to help figure out the Model's structure - i.e. what child objects an object owns and what properties it has.  You can also use the Model/Model Browser to see the instances of object and properties in that structure in a specific model.

    If you create a User-Defined script and the hit the Run button (the first toolbar button above the script), MR will switch to show you the output of the script run - this is the result of all the Document.Write statements.   You can copy/paste the results from here and do whatever with them.

    Sample scripts are located on the website under Downloads/Other Files/Scripts (Script is under the tree control on the left):

    https://www.modelright.com/files/folders/scripts/default.aspx

    Not too many users venture into this more advanced feature, but it is very powerful and kind of fun.

     Hope this helps.  Keep the questions coming...


    Scott Reynolds
    Senior Technical Support
    ModelRight, Inc.
  •  07-04-2008, 5:09 PM 692 in reply to 689

    Re: Scripting documentation and "hello world"

    Thanks admin for the quick reply!

    As you reasoned, I had not discovered the Meta Model browser - in fact I had in mind to ask "what's this MetaModel stuff that keeps showing up?"...  and had searched help for MetaModel with no satisfaction, managing to miss "Meta Model" in both search and index. Doh!

     So, Meta Model == application API Object Model.  Got it.

    > Not too many users venture into this more advanced feature

    Of the users starting with least barrier-to-entry will be a large set to whom VBA is familiar, likely from Access or Excel. For us, a very few added clues in the help would make for immediate adoptability:

    1. I'd strongly suggest adding to one of the Concepts > Scripting pages a sentence or two and a link for Meta Model, as that vastly decreases the barrier-to-entry for scripting!

    2. On the Meta Model Browser page you might mention that this browser is the equivalent of the Object Browser in VBA.

    3. A quickee example of controlling MR from VBA, which may already be familiar, and has conveniences like IntelliSense.

    Thanks again, Graham