How do I get a list of files in a folder using javascript?

How do I get a list of files in a folder using JavaScript? Or is there a plug-in that lists the folder file names n that data source that I can use in my script?

You may use the Folder Listing Input plugin in Workflow

Hi Rod,

Grabbing the folder name from the XML that the Folder Listing creates includes the full path.

<folder>C:\Samples&lt;file>

or

<path>C:\Samples&lt;/path>

I usually use a script to break the string down into an array and get only the folder name that way. Seeing this post I was wondering if there was a more eloquent way that I am missing.

I’m sure that Katie would find this helpful too.

Regards,

S

I think you have got that right. The only thing I would add here is that the Folder Listing plugin has a job info variable which you can use in your script. If you look at the “Other” tab of the Folder Listing plugin, you will see that %1 is assigned the full path of your Input folder.

Yeah, I have used the %1 too in a script the way you explained. Was just wondering if there was something I might have missed to get just the folder name. I know R&D have their hands full but perhaps something like that can be added in a future update? I always try to think of these sorts of additions for those who are not programmers.

Thanks for the quick reply.

Regards,

S

This would be a nice addition.

Steve