Import into folder not working
Posted: June 2nd, 2005, 5:25 am
I'm importing some files and I want them to go into a folder I have specified but it is not working. Here's my code:
I thought you could deselect everything, then select the folder you wanted your items to import into, but it's not working. All my items go to the project root.
Code: Select all
//get the currently selected items
var selectedItems = app.project.selection;
// Loop through the selection and deselect everything
for (var i = 0; i < selectedItems.length; i++){
selectedItems[i].selected = false;}
//reselect the photo folder. this var was set earlier in the script
//it is a folderitem in the project
photoFolder.selected = true;
//Setup options and import the file from folder
//compData array contains the file info and some other data
var myfile = compData[2];
var myIO = new ImportOptions(myfile);
myIO.importAs = ImportAsType.FOOTAGE;
proj.importFile (myIO);
//set variable for newly imported item
var curSel = proj.selection;
var newImport = curSel[0];