The Dict Object
The Dict object in JS is a companion to the dict object you create in a Max patcher. It provides the ability to access structured data (a dictionary) associated with a name.
var d = new Dict("name")
If no name is provided as an argument then a unique name will be generated for the dictionary.The following properties mirror the attributes of the same name from the Max dict object. See the dict reference for more details.
Access or set the name of a dict object as a property of the dict object
quiet [boolean] (default: false)
The quiet property functions the same as the @quiet attribute to dict in Max. It suppresses many errors or warnings if set to true.
Add values to the end of an array associated with the specified key.
Erase the contents of the dictionary, restoring to a clean state.
Make a clone of the incoming dictionary.
Return a 0 or 1 indicating the specified key exists (or doesn't) in the dictionary.
Return the value associated with a key.
Return a list of all the keys in a dictionary.
Return a list of all the dictionaries that currently exist.
Return the number of values associated with a key.
Return the type of the values associated with a key.
Replace the content of a dictionary.
Pull the content of a named coll object into the dictionary.
Push the dictionary's content into a named coll object. The keys in the dictionary will become the indices in the coll, and the values for those indices the values of the dictionary's keys.
Read the dictionary contents from a file.
Remove a key and its associated value from the dictionary.
Set the value for a key to a specified value, creating heirarchy.
Set the value for a key to a specified value.
Set the value for a key to dictionary content defined using JSON.
Open a save dialog to write the dictionary contents to a file.
Return the content of the dictionary as a JSON string.
Read a file from disk in the JSON format.
Write a file to disk in the JSON format.
Read a file from disk in the YAML format.
Write a file to disk in the YAML format.
ExamplesExample code can be found in the "js" tab of the dict help patcher.