Open All Files one by one
- This topic has 3 replies, 3 voices, and was last updated 4 years, 1 month ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Open All Files one by one
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Open All Files one by one
Hi All,
Greetings.
I have written a script, which works in one .indd file. I have 100s of .indd files, in which I have to run this particular script once. I want to automate this too. The steps are as follows.
1) Open first X.indd file in a particular folder or directory.
2) Run the script.
3) Save and close the .indd file with a X_Script_Applied.indd name.
4) Repeat step 1 with the 2nd file in the directory.
How to do this?
Thanks in advance
Use the Folder object:
var fol = Folder(“some/path”);
var inddFiles = fol.getFiles(“*.indd”);
for (var i = 0; i < inddFiles.length; i++) {
var doc = app.open(inddFiles[i]);
//do stuff
}
Thank you Very much Brian.
You can also use the BatchScript to run another script on all the InDesign files within a folder.
Try that as well…
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!