General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion VBScript to create a boilerplate checker

  • marcolara

    VBScript to create a boilerplate checker

    Participants 0
    Replies 1
    Last Activity 13 years, 5 months ago

    Dear all,

    I have been reading your great posts for a while and it seems now is my time to post an issue.

    Here is my situation. I am using KMS and XMetal. I have a ton of xml documents and I need to check whether the boilerplates are up to date. Basically, I need to compare the boilerplate names against the names in the items in the attribute inspector.

    I would like to create a little VBScript macro that would do that for me, but I have absolutely no idea how to do it.

    In short, I am looking for ways to do the following using VBScript:

    1. Switch to the Plain Text View.

    2. Search for items in the attribute inspector.

    If anyone knows any way to do any of the following will obtain my eternal gratitude. Also, any other ways to achieve the same thing will be appreciated.

    Thanks a lot for reading my post!



    Derek Read

    Reply to: VBScript to create a boilerplate checker

    The API for switching to PlainText view is documented in the Programmer Guide.

    The call in VBScript would be:
    ActiveDocument.ViewType = sqViewPlainText

    You may wish to get a copy of XMetaL Developer, but at least have a look at the Programmers Guide:

    You cannot really “search for items in the Attribute Inspector”. When looking for specific attribute values in a document there are several different ways to do this and many APIs that will help with that. All of these APIs are actually looking at the XML source text or the DOM tree. That may sound nit-picky, but it would be confusing if you were looking in the Programmers Guide for APIs to interact with the Attribute Inspector this way and could not find any.

    If you could be very specific about what you need to do (for example, after you find a specific value then what?) perhaps someone would be willing to help write an example you could work from.


  • You must be logged in to reply to this topic.

Lost Your Password?