Skip to content

Instantly share code, notes, and snippets.

@hilukasz
Created June 9, 2012 03:21
Show Gist options
  • Save hilukasz/2899236 to your computer and use it in GitHub Desktop.
Save hilukasz/2899236 to your computer and use it in GitHub Desktop.
function getAllTextItems(){
var doc = app.activeDocument;
for(var j = 0; j < doc.textFrames.length; j++){
var currentTextItem = doc.textFrames[j];
// loop through all the symbols to check if it is in the div
for(var i = 0; i < allParentsOfSymbols.length; i++){
var container = allParentsOfSymbols[i];
if(textIsIn(currentTextItem, container)) {
var left = Math.round(currentTextItem.anchor[0]),
top = Math.round(currentTextItem.anchor[1]),
font = currentTextItem.textRange.characterAttributes.textFont.name,
style = currentTextItem.textRange.characterAttributes.textFont,
alignment = currentTextItem.textRange.characterAttributes.alignment,
fontSize = alignment = currentTextItem.textRange.characterAttributes.size,
contents = currentTextItem.contents;
// only write file on last itteration
if(i == allParentsOfSymbols.length-1){
CSV.append(["null","null",container.name,top, left, contents, "text", "null", fontSize, alignment,font, style, getTodaysDate()+"\n"]);
}
}
}
}
}getAllTextItems();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment