script to check svg files is corrupted or not
Hello all,
i am having 1000 svg files in a folder , i want to know which svg files is corrupted (Not opening in Adobe Illustrator).

Just i want store doc name in .txt format later on i will create newsvg file .
i have tried in .net and VB script but nothing is working
C# code
string[] dataFiles = System.IO.Directory.GetFiles(textBox1.Text, "*.svg");
try
{
for (var i = 0; i < dataFiles.Length; i++)
{
Illustrator.Application illuApp = new Illustrator.Application();
try
{
Illustrator.Document illuDoc = illuApp.Open(dataFiles, Illustrator.AiDocumentColorSpace.aiDocumentRGBColor, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
Process[] processes12 = Process.GetProcesses();
foreach (Process p1 in processes12)
{
if (p1.MainWindowTitle.Contains("Adobe Illustrator"))
{
SetForegroundWindow(p1.MainWindowHandle);
System.Threading.Thread.Sleep(1000);
SendKeys.Send("O");
System.Threading.Thread.Sleep(3000);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
}
VBA Script
Sub macro_test()
Set fso = CreateObject("Scripting.FileSystemObject")
For Each myfile In fso.GetFolder("d:\LocalData\z015266\Desktop\New folder (9)\New folder (3)").Files 'looping all AI files
If Right(myfile.Name, 2) = "AI" Or Right(myfile.Name, 2) = "ai" Or Right(myfile.Name, 3) = "svg" Then ' end if
Set iapp = New Illustrator.Application
On Error GoTo Loop1
Set idoc = iapp.Open(aifile)
Set myDoc = iapp.ActiveDocument
aifile = myfile
End If
Next myfile
Loop1:
MsgBox ("H1")
End Sub
Thanks and Regards,
Yogesh