Hi,
I need to prepare a script that should check and log number of files in a folder.
This is to check the text objects in the document whether it contains any color text (non black text).
Problem with my script is that
1. it wont loop trough all the files in the folder, it just check the first file and ends.
2. if a document consist of more number of text in color it writes each times upto the length of text in color. i just want single instance of check for a single file.
#target illustrator var inputFolder = Folder.selectDialog ("Select a folder contains '*.eps' files ") var Loginfo = new File(inputFolder+"/ScriptLog.txt"); Loginfo.open("w", "TEXT", "????"); if (inputFolder != null){ var fileList = inputFolder.getFiles('*.eps'); for (var i = 0; i < fileList.length; i++){ if (fileList[i] instanceof File && fileList[i].hidden == false){ var docRef = open( fileList[i] ) writeLog() app.activeDocument.close(SaveOptions.DONOTSAVECHANGES) } } } Loginfo.close(); //This function is to check the text objects in the document whether it contains any color text (non black text). function writeLog(a){ var a = app.activeDocument if(a.textFrames.length>0){ for (i = 0; i < a.textFrames.length; i++ ){ var text = a.textFrames[i].textRange; var fiTxtColor = text.fillColor; var txtColorType = String (fiTxtColor) var txtColorGray = txtColorType.search ('Gray') if(txtColorGray != 1){ Loginfo.writeln("File: "+a.name+" Text not in Black") } } } }
Hope i clearly explained my need.
Help me on this Guys..!!!!
Thanks in advance..