使用以下JavaScript代码来检查AI文件中是否缺失画板并修复它们:
//open file var doc = app.open(File("YOUR_FILE_PATH"));
//get all artboards var artboards = doc.artboards;
//loop through artboards to check if any are missing for (var i = 0; i < artboards.length; i++) { if (!artboards[i].name) { //if artboard is missing, create new artboard with same properties var newArtboard = doc.artboards.add(artboards[i].artboardRect); newArtboard.name = "Artboard " + (i + 1); } }
//save changes and close file doc.save(); doc.close();
请将“YOUR_FILE_PATH”替换为要修复的AI文件的路径。执行此代码将自动修复缺失的画板并保存更改。