im currently developping a script with extends script which is a javascript-similar script language, that we use to automate tasks in Adobe's Softwares (here its premiere pro) Here is what my code is doing : -i import files from a folder in my computer -then i put them in a bin in my prpro project -and for each of this file i create a bin with the file and a sequence
My problem is that the last file is not move in a bin
here is my code
root = app.project.rootItem
newFilesPath = "C:/Path"
newFilesBin = root.children[0]
app.project.importFiles(newFilesPath, true, newFilesBin, false)
app.project.save()
newFilesBin = root.children[0]
for(i=0; i<newFilesBin.children.numItems; i++){
newFile = newFilesBin.children[0]
name = newFile.name
newBin = root.createBin(name)
file.moveBin(newBin)
}
So if i put several file in the path it doesnt move the last file instead of moving every files
Thanks for help
I found the solution :
i just change the parameters of my for loop
for(i=-1; i<newFilesBin.children.numItems+1; i++)
I dont exatly know why its working but it works