<commit_before>// Include the JSON helper
#include "./helpers/JSON.jsx"
// Include the descriptor-info module
#include "../jsx/descriptor-info.jsx"
  
// ActionDescriptor example  
var ref = new ActionReference();  
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  
var desc = executeActionGet(ref);   

// Retrieve its properties by running the getProperties function, passing the ActionDescriptor as a param
// Optional param object: descFlags
// Optional flag boolean: reference - return reference descriptors. Could slighly affect speed.
var descFlags = {
    reference : false
};

var descObject = descriptorInfo.getProperties( desc ); // If using descFlags --> descriptorInfo.getProperties( desc, descFlags );

// Running in ExtendScript
$.writeln(JSON.stringify(descObject, null, 4));

// Running in Brackets with the Brackets-to-Photoshop extension
// https://github.com/JavierAroche/brackets-to-photoshop
// Brackets-to-Photoshop extension includes the JSON helper by default
$.writeln(descObject);<commit_msg>update(descriptor-info-example): added extended flag to descFlags in example<commit_after>// Include the JSON helper
#include "./helpers/JSON.jsx"
// Include the descriptor-info module
#include "../jsx/descriptor-info.jsx"
  
// ActionDescriptor example  
var ref = new ActionReference();  
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  
var desc = executeActionGet(ref);   

// Retrieve its properties by running the getProperties function, passing the ActionDescriptor as a param
// Optional @param {Object} descFlags
// Optional @flag {Boolean} reference - return reference descriptors. Could slighly affect speed.
// Optional @flag {Boolean} extended - returns extended information about the descriptor.
var descFlags = {
    reference : false,
	extended : false
};

var descObject = descriptorInfo.getProperties( desc ); // If using descFlags --> descriptorInfo.getProperties( desc, descFlags );

// Running in ExtendScript
$.writeln(JSON.stringify(descObject, null, 4));

// Running in Brackets with the Brackets-to-Photoshop extension
// https://github.com/JavierAroche/brackets-to-photoshop
// Brackets-to-Photoshop extension includes the JSON helper by default
$.writeln(descObject);
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0008680555555555555, 'mean_word_length': 4.6495098039215685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '110164', 'n_tokens_mistral': 650, 'n_tokens_neox': 624, 'n_words': 202}