dropdown list feeded by folder content on harddrive

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
payton
Posts: 10
Joined: January 30th, 2009, 4:11 pm

hi,
im working on a script where the artist should choose an animation preset first, that gets applied to some layers later in the script.
it would be perfect to let the script read a folder content.

f.e.:

\\networkshare\example

preset1.ffx
preset2.ffx
preset3.ffx

everytime the script runs it should reflect the content of the folder in a dropdownlist.

i dont need a finished script, but any tip or hint would be great as a starting point.

thanks in advance,
payton
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

Hi Paynton,

the Folder.getFiles() function will return an array of all files and folders as objects in that folder. It also accepts a function that can be used as a mask so that it only returns .ffx files or you can loop through the array and filter out the .ffx files afterwards (might be less confusing this way). You can then add the files names to a drop down list. Hope that sets you in the right direction.

-Lloyd
payton
Posts: 10
Joined: January 30th, 2009, 4:11 pm

hi lloy,
unfortunately i dint receive a mail after your reply.
luckily i found it yesterday.
thanks for your tips.

im still having some problems to access the selection of the dropdownlist from outside the gui function. but i will give it another try tomorrow.

thanks again,
payton
Post Reply