Home › Forums › General XMetaL Discussion › Set Track Changes text color programmatically in XMetaL Author Essential 5.5 › Reply To: Set Track Changes text color programmatically in XMetaL Author Essential 5.5
Reply to: Set Track Changes text color programmatically in XMetaL Author Essential 5.5
January 18, 2010 at 11:05 pmThe 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
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.