NAILED IT! Silly-V‌ THANK YOU SO MUCH!!! Here is the output.... <meta name="SN Effectivity 1" content="LNB1-UP, LZB1-UP, L8D1-UP, LXK1-UP, CE51-UP, LNA1-UP, LZA1-UP, L8B1-UP, LXJ1-UP, CE31-UP, NH31-UP, DH41-UP, NH41-UP"> Here is the final code:
#target illustrator
var doc = app.activeDocument;
var allText = doc.textFrames;
var allLayers = doc.layers;
var count = 0;
var dashFrames = new Array();
for (z = 0; z < allLayers.length; z++) {
if (allLayers .name == "Single Line" || allLayers .name == "Two Line" || allLayers .name == "Three Line" || allLayers .name == "Four Line") {
//alert("Found single two three four layer");
for (i = 0; i < allText.length; i++) {
if (allText.typename == "TextFrame") {
//alert(allText.layer);
if (allText.layer != "[Layer Single Line]") {
//skip it
} else {
if (allText.contents.match("-")) {
if (allText.contents.substr(0, 4) == "UENR" || allText.contents.substr(0, 4) == "RENR" || allText.contents.substr(0, 4) == "SENR" || allText.contents.substr(0, 4) == "KENR") {
//skip it
} else {
dashFrames[count] = allText.contents.replace(/^.[^\n\r]+/, "").replace(/^[\r\n]/,"").split(/[\n\r]/);
count++;
}
}
}
}
}
}
}
var str = '<meta name="SN Effectivity 1" content="' + dashFrames.join (",").replace(/,/g, ", ") + '">\r';
var f = File("~/Desktop/" + "SN Info.txt");
f.open('w');
f.write(str);
f.close();
So could you maybe explain this part of line 18 to me? I am not a programmer....I get by (with some help)
replace(/^.[^\n\r]+/, "").replace(/^[\r\n]/,"").split(/[\n\r]/);
I understand the replace function and \n = new line? \r = carriage return? But what about the /^. and +/ Thank you again for your help and time!
... View more