Code: Select all
main();
function main() {
app.beginUndoGroup("Apply CSV to Text Layers");
//Alert user to select a CSV file_____________________________________________________________________________________
var gotData = false;
while (!gotData) {
var csv = confirm("Please select a CSV file.");
var selectFile = fileGetDialog("Please select a CSV file.", "");
var encoded_data = '';
if (csv == true) {
if(selectFile == null) { //Error detection
alert("No CSV file selected. ");
}
else {
var readData = selectFile.open("r","TEXT", "????");
if(readData) {
var encoded_data = selectFile.read();
}
else { //Error detection
alert("Problems reading csv file");
}
gotData = true;
}
}
else {
exit();
}
} //end get CSV file
//___________________________________________________________________________________________________________
}