Page 1 of 1
Cycle that scrolls all the images of a folder
Posted: Tue Nov 13, 2018 5:21 pm
by AlessioForconi
Hello everyone,
I have a series of images (1.png, 2.png, 3.png etc etc) in a folder and I would like to run a loop that scrolls all the images themselves, I need to extract one based on specific conditions.
I do not know how to refer to the elements (the images in the folder).
I guess I have to put them in a matrix or similar, but I do not understand the way.
Thank you
Re: Cycle that scrolls all the images of a folder
Posted: Tue Nov 13, 2018 7:06 pm
by Klaus
Hi Alessio,
not ure what you mean, maybe:
Code: Select all
...
put "path/to_your/image_folder" into tFolder
put files(tFolder) into tFiles
## Now you have a CR delimited list of all files in that folder in -> tFiles
## Do whatever you need with this list...
## Is that what you were looking for?
...
Best
Klaus
Re: Cycle that scrolls all the images of a folder
Posted: Tue Nov 13, 2018 7:26 pm
by AlessioForconi
Yes, I was trying to do just that
But if I put
put defaultFolder & "/ days /" into tFolder
put files (tFolder) into tFiles
repeat for each item temp in tFiles
answer temp
end repeat
do I get a list of all files at the same time and it does not flow through every single file?
I have to select one based on the name.
Re: Cycle that scrolls all the images of a folder
Posted: Tue Nov 13, 2018 7:30 pm
by Klaus
Code: Select all
...
put defaultFolder & "/ days /" into tFolder
put files (tFolder) into tFiles
## repeat for each item temp in tFiles
repeat for each LINE temp in tFiles
answer temp
end repeat
...
Is this what you were missing? -> LINE (not ITEM!)
Re: Cycle that scrolls all the images of a folder
Posted: Tue Nov 13, 2018 7:32 pm
by AlessioForconi
Exatcly! Thanks Klaus
