Created
June 9, 2012 03:21
-
-
Save hilukasz/2899236 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
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