Skip to main content
Participating Frequently
February 6, 2011
Answered

Open documents within a folder without specifying filenames

  • February 6, 2011
  • 1 reply
  • 464 views

Hi there,

I need to batch apply some script to all documents within a specified folder. Can I open each document one by one without specifying the filename?

So, instead of:

var myDocument = app.open(File(Folder.desktop + "/OpenDocument.indd"));

Something like:

var myDocument = app.open(File(Folder.desktop + "/" + documents[0]));

Obviously that doesn't work, but hopefully it illustrates what I am trying to achieve.

Thanks in advance,

rmsteel

This topic has been closed for replies.
Correct answer _Jongware_-9BC6tI

Folder.getFiles will return a list of all files in that folder as an array

1 reply

_Jongware_-9BC6tICorrect answer
Inspiring
February 6, 2011

Folder.getFiles will return a list of all files in that folder as an array

rmsteel01Author
Participating Frequently
February 6, 2011

Perfect, thanks!