ID=-108 error
Hello all ,
Urgent request , i have to finish this code with the help of scripting .
i am having 200 files in a folder , previously i have got error adobe illustrator not responding , and then i have got parm error all these problems now it is rectified , but now i am gettting error ("adobe illustrator can't finish previewing there is not enough memory in illustrator" ) after running for 100 files . can any one suggest me to add line to clear memory in illustrator so illustrator cant occupy any memory .
this is my part of the code, please help me it is so urgent ,sorry to disturb u all .
function read_ai()
{
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files', '~' );
files = sourceFolder.getFiles(/\.(svg|ai)$/i);
sourceFolder1 = Folder.selectDialog( 'Select the folder to save ai files', '~' );
if(files.length == 0)
{
//alert("Folder doesnot have any file");
}
if ( files.length > 0 )
{
// //alert(files.length);
for ( var file_iteration = 0; file_iteration < files.length; file_iteration++ )
{
var compare_title_name_fn_called = 0;
fileArray_title=[];
sourceDoc = app.open(files[file_iteration]); // returns the document object
var fileExtension = sourceDoc.name.substr((sourceDoc.name.lastIndexOf('.') + 1));
if(fileExtension=="ai")
{
var yog_lays= sourceDoc.layers;connector_array_inside_grp = [];
for(var layer_iteration=0;layer_iteration<yog_lays.length;layer_iteration++)
{
var RANGE_group_check_flag=0;
var compare_title_name_fn_called=0;
if(yog_lays[layer_iteration].name=="RANGE" )
{
RANGE_group_check_flag=1;
var yog_text=yog_lays[layer_iteration].textFrames;
for(var text_iteration=0;text_iteration<yog_text.length;text_iteration++)
{
var ref_textframe = yog_text[text_iteration].textRange.characters[0].size;if(ref_textframe==12)
{
fileArray_title.push(yog_lays[layer_iteration].textFrames[text_iteration].contents);
}
}
}
else if(yog_lays[layer_iteration].name=="Layer 1")
{
LAYER1_group_check_flag=1;
var yog_grp=yog_lays[layer_iteration].groupItems;
for(var text_iteration=0;text_iteration<yog_grp.length;text_iteration++)
{
if(yog_grp[text_iteration].name == "<CIRCUIT TITLE>")
{
fileArray_title.push(yog_grp[text_iteration].textFrames[0].contents);
}
}
}
}if(fileArray_title.length==1)
{
color_empty_pathitem();
remove_fuse_group();
check_fuse_ungroup();
rename_fuse_group();
check_connector();
check_connector_grp();
check_connector_callout();
move_rectangle();
group_connector_name();
check_text_empty_high();
line_check1_unit_CAN(fileArray_title[0]);
line_check1_unit_2_CAN(fileArray_title[0]);
wave_unit_check();
rectangle_inside_path_items_check(fileArray_title[0]);
variant_terminal_check(fileArray_title[0]);
group_Circle_name_CAN(fileArray_title[0]);
checking_circleGroup_CAN(fileArray_title[0]);
check_unwantedline_CAN(fileArray_title[0]);
renaming_path(fileArray_title[0]);
renaming_CAN(fileArray_title[0]);
line_pathitem_inside_CAN(fileArray_title[0]);
check_AAA_names();
error_check();
}
var saveOptions = new IllustratorSaveOptions();
var ai8Doc = new File(sourceFolder1);
sourceDoc.saveAs( ai8Doc, saveOptions );
sourceDoc.close();}
}
}
}
