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];