Copy link to clipboard
Copied
I've scripted a program for ps and one of the steps gathers the files. unfortunately, one of our team members is on an earlier version of windows and a thumbs.db keeps getting into the getfiles() return.
I was wondering if there is a way to filter out this file from the request.
thanks!
I would find another way for "latest edited one". Get the date/time stamp on "latest file I care about"?
OR
How to Switch Off the Thumbs.db Image Cache File in Windows — SitePoint
Copy link to clipboard
Copied
I would suggest a whitelist (files you llike) and not a blacklist (files you do not like). Find the files you WANT to process. Image Processor script has this function
function IsFileOneOfThese( inFileName, inArrayOfFileExtensions ) {
And gets a list of extensions that Photoshop knows how to open (see gFileExtensionsToRead). (And deals with those pesky users that don't have an extension!)
if (IsFileOneOfThese( cameraRawParams.fileName, gFileExtensionsToRead ) ||
IsFileOneOfTheseTypes( cameraRawParams.fileName, gFileTypesToRead ) ) {
Copy link to clipboard
Copied
Well, the thing is that the files i do want are folders, and not files with extensions. How do i identify Folders?
Copy link to clipboard
Copied
Well I don't think you should identify folders. Just recurse into all of them. You could easily set up an array of folders to ignore or folders to process however.
Copy link to clipboard
Copied
The script looks into the (Main) folder, and makes a list of all the sub-folders. Unfortunately, the (thumbs.db) file is always also a file inside the (Main) folder. The next thing that i do after getting the list of folder is identifying which was the latest edited one, and for some reason it always returns with the thumbs.db file, since it looks like windows updates this quite regularly.
Copy link to clipboard
Copied
I would find another way for "latest edited one". Get the date/time stamp on "latest file I care about"?
OR
How to Switch Off the Thumbs.db Image Cache File in Windows — SitePoint
Copy link to clipboard
Copied
You are awesome thanks!