I was looking to log a common screen name from the alias of the object as an example of a custom message. So if there is a pattern of how you want to customize, you may be able to do something similar. In the following example, I take the LogParams of the checkpoint event, strip out the object name then do a lookup to a table of Alias to common, human readable name.
I don't know if this example is useful.
function GeneralEvents_OnLogCheckpoint(Sender, LogParams)
{
var objectName = GetObjectName(LogParams.AdditionalText);
LogParams.MessageText = LookUpObjectinProject(objectName) + LogParams.MessageText;
}
// String maniulation to get the object name of the mapped name
// RETURN that object name string.
function GetObjectName(additionalText)
{
// String manipulation gets the name of the object objectName
var intPosOne = additionalText.indexOf("<td>") + 4;
var intPosTwo = additionalText.indexOf("</a>");
var objectName = additionalText.substring(intPosOne, intPosTwo);
intPosOne = objectName.indexOf(">") + 1;
objectName = objectName.substring(intPosOne);
// string manipulation to get objectName compelte
return objectName;
}
// Take name input parameter and look for a common name in the PROJECT VARIABLE that
// has a 2 column table of object names and their corresponding common human understandable, name.
// If a common name exists, return it, else an empty string is returned.
function LookUpObjectinProject(objectName)
{
var commonName = "";
// get common name lookup table
if (Project.Variables.VariableExists("ScreenObjectCommomName")) // if the table does not exist, do no translation
{
var t = Project.Variables.ScreenObjectCommomName;
var iterator = t.Iterator;
iterator.Reset();
while (!iterator.IsEOF())
{
if (iterator.Value(0) == objectName)
{
commonName = iterator.Value(1) + " ";
break;
}
iterator.Next();
}
}
return commonName;
}