General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Set Track Changes text color programmatically in XMetaL Author Essential 5.5

  • lqian

    Set Track Changes text color programmatically in XMetaL Author Essential 5.5

    Participants 0
    Replies 1
    Last Activity 12 years, 8 months ago

    Hi,

    In XMetaL Author Essential 5.5,  the inserted text, for Track Changes, is configurable by user in the Tools>Options>Change Tacking(See Attached sceen shot).

    Is it possible I can change the inserted text color setting programmatically?

    Reply

    Derek Read

    Reply to: Set Track Changes text color programmatically in XMetaL Author Essential 5.5

    The answer is yes, but there are no specific APIs in XMetaL Author that let you do this (XMAX has design time settings for this but we are not seeing a demand for the same for Author, and they must be set before launching XMAX which is possibly different from what you need).

    However, I say “yes” because you can write a script that will modify the Windows Registry to affect such a change for XMetaL Author. The settings are stored inside and read from the following registry key:
    HKEY_CURRENT_USERSoftwareSoftQuadXMetaL Track Changes

    Please use the following example with caution as it modifies the Windows registry.

    [code]//XMetaL Script Language JScript:
    function writeKeyString(path,value) {
    try {
      var wShell = new ActiveXObject(“WScript.Shell”);
      wShell.RegWrite (path,value,”REG_SZ”);
    }
    catch(e) {
      Application.Alert(“Unable to save some settings.nn” + “Error writing to the Windows Registry: ” + e.description);
    }
    }

    var regBasePath = “HKEY_CURRENT_USER\Software\SoftQuad\XMetaL ” + Application.VersionNumber + “\Track Changes\”;
    var regDeletedColor = regBasePath + “DeletedColor”;
    var regDeletedMark = regBasePath + “DeletedMark”;
    var regInsertedColor = regBasePath + “InsertedColor”;
    var regInsertedMark = regBasePath + “InsertedMark”;

    writeKeyString(regDeletedColor,”Red”);
    writeKeyString(regDeletedMark,”Hidden”);
    writeKeyString(regInsertedColor,”Blue”);
    writeKeyString(regInsertedMark,”Bold”);[/code]
    Note: Do not set these registry settings to values not exposed to the user in Tools > Options on the Change Tracking tab.

    Reply

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

Lost Your Password?

Products
Downloads
Support