Also are you saying you already have a representation of the dictionary in a JSON file?
What do you want to do with the dictionary when you have loaded it.
Then you can parse it by this:
//=============
var dictn = app.ReadFile( "dictionary.json" );
var parsed = JSON.parse(dictn);
var word = "apple";
var meaning = parsed[word];
alert(meaning);
How can I load a dictionary from JSON file and how can I use the data from him?
function addToWords(word, definition, save)
{
words[word]=definition;
if(save)
{
writeAsJson(wordFile,words,true);
}
}
//general purpose function to store object in file
function writeAsJson(path, obj, pretty)
{
//if pretty==true, add spacing to json
var fmt = pretty ? 1 : null;
app.WriteFile(path, JSON.stringify(obj, null, fmt));
}