• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Excluding Thumbs.db from Getfiles()

Explorer ,
Apr 04, 2017 Apr 04, 2017

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!

TOPICS
Actions and scripting

Views

854

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Apr 04, 2017 Apr 04, 2017

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

Votes

Translate

Translate
Adobe
Adobe Employee ,
Apr 04, 2017 Apr 04, 2017

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 ) ) {

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2017 Apr 04, 2017

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 04, 2017 Apr 04, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2017 Apr 04, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 04, 2017 Apr 04, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

You are awesome thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines