Copy link to clipboard
Copied
hi into this function
var myFolder = Folder(defaultFolder).selectDlg("Select the folder containing InDesign Files");
//var myFolder = Folder.selectDialog("Select the folder containing InDesign Files", "");
if (!myFolder) exit();
var f = myFolder.getFiles(/\.(indd)$/i);
var doc;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
//Opens each ID file and runs the
for (var i = 0; i < f.length; i++){
doc = app.open(File(f[i]));
doc.links.everyItem().update();
OpenAndUpdate(doc);
};
i select a folder for scan all indd files
but i have so much files (1000 files),i want select only file with name "etiquette finie.indd" (70 files)
thanks for you help
Try the following code
function findAll (f, flist)
{
var f = Folder(f).getFiles("*.*");
for (var i = 0; i < f.length; i++)
{
if (f[i] instanceof Folder && f[i].name[0] != ".")
findAll (f[i], flist);
else
{
if(f[i].displayName == "etiquette finie.indd")
flist.push(f[i])
}
}
}
var myFolder = Folder(defaultFolder).selectDlg("Select the folder containing InDesign Files");
//var myFolder = Folder.selectDialog
...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Nope it s in side different sub folder
Copy link to clipboard
Copied
Try the following code
function findAll (f, flist)
{
var f = Folder(f).getFiles("*.*");
for (var i = 0; i < f.length; i++)
{
if (f[i] instanceof Folder && f[i].name[0] != ".")
findAll (f[i], flist);
else
{
if(f[i].displayName == "etiquette finie.indd")
flist.push(f[i])
}
}
}
var myFolder = Folder(defaultFolder).selectDlg("Select the folder containing InDesign Files");
//var myFolder = Folder.selectDialog("Select the folder containing InDesign Files", "");
if (!myFolder) exit();
var f = []
findAll(myFolder, f)
var doc;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
//Opens each ID file and runs the
for (var i = 0; i < f.length; i++){
doc = app.open(File(f[i]));
doc.links.everyItem().update();
OpenAndUpdate(doc);
};
-Manan
Copy link to clipboard
Copied
perfect