<commit_before># Descriptor Info

## Description
JSX module to recursively get all the properties in an `ActionDescriptor` used in Adobe applications.

## Usage

**getProperties**

Return complete Descriptor info in JSON format

* 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.

**Sample code for getting Descriptor properties with getProperties**
```javascript
// Include the descriptorInfo module
#include "~/dev/descriptor-info/jsx/descriptor-info.jsx"

// ActionDescriptor example
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);

// Optional
var descFlags = {
    reference : false,
	extended : false
};

// Retrieve its properties by running the getProperties function, passing the ActionDescriptor as a param
var descObject = descriptorInfo.getProperties( desc, descFlags );
```


**JSON returned for requested Descriptor info.**
```javascript
{
    "name": "Layer 0",
    "color": "none",
    "visible": true,<commit_msg>update(): updated examples in README<commit_after># Descriptor Info

## Description
JSX module to recursively get all the properties in an `ActionDescriptor` used in Adobe applications.

## Usage

**getProperties**

Return complete Descriptor info in JSON format
```javascript
/**
  * @param {Boolean} reference - return reference descriptors. Could slightly affect speed. Default = false.
  * @param {Boolean} extended - returns extended information about the descriptor. Default = false.
  * @param {Number} maxRawLimit - limits the max number of characters from a RAWTYPE descriptor. Default = 10000.
  * @param {Number} maxXMPLimit - limits the max number of characters from an XMPMetadataAsUTF8 property. Default = 10000.
  * @param {String} saveToFile - Saves the descriptor to a JSON file. Default = '~/Desktop/descriptor-info.json'.
  */
```

**Sample code for getting Descriptor properties with getProperties**
```javascript
// 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("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);

// Optional
var descFlags = {
	reference : false,
	extended : false,
	maxRawLimit : 10000,
	maxXMPLimit : 100000,
	saveToFile: '~/Desktop/descriptor-info.json'
};

// Retrieve its properties by running the getProperties function, passing the ActionDescriptor as a param
var descObject = descriptorInfo.getProperties( desc, descFlags );
```


**JSON returned for requested Descriptor info.**
```javascript
{
    "name": "Layer 0",
    "color": "none",
    "visible": true,
{'fraction_non_alphanumeric': 0.10808973487423522, 'fraction_numerical': 0.008157715839564922, 'mean_word_length': 4.850894632206759, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6900846', 'n_tokens_mistral': 829, 'n_tokens_neox': 781, 'n_words': 298}