Skip to content

Instantly share code, notes, and snippets.

@ryanlfoster
Created May 6, 2013 19:50
Show Gist options
  • Save ryanlfoster/5527643 to your computer and use it in GitHub Desktop.
Save ryanlfoster/5527643 to your computer and use it in GitHub Desktop.
/*
extended javascript for
Adobe Indesign 5.5
by
PDXIII
http://about.me/PDXIII
Honestly: It's from fabiantheblind, but I typed it ;-)
*/
main();
function main(){
var myJSONobject;
// get the textfile
var filepath = "~/Desktop/Design/FontList.json";
var fontList = File(filepath);
alert(fontList);
var content;
if(fontList != false){
fontList.open('r');
content = fontList.read();
myJSONobject = eval("{" + content + "}");
alert(myJSONobject.length);
fontList.close(); // always close files after reading
}else{
alert("Bah!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment