Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Created December 1, 2020 08:54
Show Gist options
  • Select an option

  • Save MarshySwamp/0cd2bcbff88297f2f122a54f6d87e0d5 to your computer and use it in GitHub Desktop.

Select an option

Save MarshySwamp/0cd2bcbff88297f2f122a54f6d87e0d5 to your computer and use it in GitHub Desktop.
Open an entire folder of images
/* open an entire folder */
// Open the input folder
var inputFolder = Folder.selectDialog('Please select a folder:');
// Only open listed file extensions
var inputFiles = inputFolder.getFiles(/\.(jpg|jpeg|tif|tiff|psd|psb|eps|png|bmp|gif)$/i);
// Alpha numeric sort
inputFiles.sort();
// inputFiles.sort.reverse();
// Loop through the inFolder...
for (var i = 0; i < inputFiles.length; i++) {
var openFiles = app.open(File(inputFiles[i]));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment