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

Get only First File in a folder without going thru all the files.

Participant ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

Hi there,

I have a multiple image sequences  folders with  over 20K images in each folder. I just want to get path of first image or any one image from each folder. Ex. "path\to\folder\name_00000.jpg". 


Note first image always contains "_00000".

 

Folder.getFiles()[0] is too too slow to read all files first in folder and then take first one.

 

what might be the other way to instantly get any one file from folder?

TOPICS
Performance , Scripting

Views

85

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
LEGEND ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

You could probably construct a convoluted loop that builds an URI in the file system object and simply returns a true/ false for a file being there, but outside that scripts simply apparently can't do what AE can't since they use the interanl functions. In the past peopel also created Python Applets or little VBS scripts via Windows Scripting host to do such jobs and simply write out text files or send data to a socket connection to talk to AE scripts to avoid the limitations.

 

Mylenium

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
Community Expert ,
Nov 04, 2022 Nov 04, 2022

Copy link to clipboard

Copied

LATEST

If there's no scripting way to do this, could you instead just use the image sequence, but put a time remap / frame hold on it to only show the first frame?  A little ugly, but it would get you there.

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