hi,r-bin: Excuse me ,How do you know the document properties include “viewInfo”? i tried to reflect the document and could not get the “Viewinfo” properties。 function reflectProps(obj) {
var props = obj.reflect.properties;
var reflect= obj.reflect;
alert( obj.reflect.description)
alert( obj.reflect.help)
alert( obj.reflect.name)
alert( obj.reflect.sampleCode)
alert( obj.reflect.staticProperties)
for (var i = 0, len = props.length; i < len; i++) {
try {
$.writeln(props[i].name + ' = ' + obj[props[i].name]);
WriteData(props[i].name + ' = ' + obj[props[i].name])
} catch (e) {}
}
}
function reflectMeths(obj) {
var meths = obj.reflect.methods;
for (var i = 0, len = meths.length; i < len; i++) {
try {
$.writeln(meths[i].name + '();');
WriteData(meths[i].name + '();')
} catch (e) {}
}
}
function WriteData(Txt)
{
var file = new File(Folder.desktop + "/rflection.txt");
file.open("a", "TEXT",null);
file.encoding = "UTF8";
file.seek(0,2);
$.os.search(/windows/i) != -1 ? file.lineFeed = 'windows' : file.lineFeed = 'macintosh';
file.writeln(Txt);
file.close();
}
// Example of use:
var r = new ActionReference();
var d = new ActionDescriptor();
r.putEnumerated(stringIDToTypeID("document"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(charIDToTypeID('null'), r);
var options = executeAction(charIDToTypeID( "getd" ), d, DialogModes.NO);
var lay =options;
WriteData("\n*************** properties **********************\n")
reflectProps(lay);
WriteData("\n*************** methods **********************\n")
reflectMeths(lay);
... View more