Read in JSON data and parse it as actual JSON


hi all,

 

i'm trying read in external json file , parse usable json object.

 

i have following:

 

var datafile = file.opendialog("select data file.", "json");

var data = "";

 

if(datafile != null && datafile.exists) {

    datafile.open("r");

    while(!datafile.eof) {

        data += datafile.readln();

    }

    datafile.close();

}

 

// parse json retrieved file above.

data = someparsefunction(data);

 

does scripting library come base json parser?

 

thanks help,

 

- aric

i'll answer own question after playing around bit.

 

data = eval(data);

 

although handy not rely on eval function in future.

 

- a



More discussions in After Effects Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support