Copy link to clipboard
Copied
Hi Community, this is my first week using ExtendScript. I have been able to pretty quickly create a lot of powerful little scripts but this is alluding me for some reason... What I am trying to do after opening a Tiff file is look in that same directory for any files of a specific extension like .jpg, just to see if they are present. The jpg's in this case have a bunch of metadata that needs to follow the Tiff. Maybe it is the 50 hours I have spent staring at Javascript this week already but I am not getting any examples I find to work. Any help would be greatly appreciated.
Copy link to clipboard
Copied
This is how to create an array of files with a jpg extension. Then you can create a loop and go through the files in the array.
var imageFolder = new Folder('~/desktop/')// put image path here
var mask = '*.jpg';
var fileList = imageFolder.getFiles (mask);
Copy link to clipboard
Copied
Thanks that was helpful. I think the pathing was tripping me up. This got me exactly what I need:
Copy link to clipboard
Copied
That's a lot of extra stuff if you just want the get the path of the active document.
var docPath = activeDocument.path;
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more