General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Set Track Changes text color programmatically in XMetaL Author Essential 5.5
-
lqian January 18, 2010 at 1:30 am
Set Track Changes text color programmatically in XMetaL Author Essential 5.5
January 18, 2010 at 1:30 amParticipants 0Replies 1Last Activity 13 years agoHi,
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?
Derek Read January 18, 2010 at 11:05 pm
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_USERSoftwareSoftQuadXMetaLTrack 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. -
AuthorPosts
- You must be logged in to reply to this topic.