We’ve already seen two ways to get at the IsCharacterKeySet parameter: 1) using the GetValue command, and 2) using XSICollection.Items.
Now, here’s a third way, using Dictionary.GetObject(). Dictionary.GetObject takes a string name and returns the corresponding object:
var oProp = Selection(0); var oParam = Dictionary.GetObject( oProp + ".IsCharacterKeySet" ); LogMessage( oParam.Value );
So what’s the best way to get IsCharacterKeySet? One thing to consider is that GetValue and Dictionary.GetObject both fail if the string does not resolve to an object. XSICollection.Items, on the other hand, won’t fail; you just have to check the .Count property after to see whether you got the parameter.