Created
May 6, 2013 19:50
-
-
Save ryanlfoster/5527643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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