Skip to content

Instantly share code, notes, and snippets.

@ryanlfoster
Created May 6, 2013 20:08
Show Gist options
  • Save ryanlfoster/5527765 to your computer and use it in GitHub Desktop.
Save ryanlfoster/5527765 to your computer and use it in GitHub Desktop.
/*
extended javascript for
Adobe Indesign 5.5
by
PDXIII
http://about.me/PDXIII
originally by fabiantheblind
https:github.com/fabiantheblind
*/
function loadJSONObject(filepath){
var myJSONfile = File(filepath);
if(myJSONfile != false){
myJSONfile.open('r');
myJSONObject = eval("{" + myJSONfile.read() + "}");
myJSONfile.close(); // always close files after reading
return myJSONObject;
}
else{
alert("Bah!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment