Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Save in Parent source folder

$
0
0

Hello I am pretty new to After Effects scripting ,and i am trying to make a script to import files and then save  project in parent's sources files folder .

But i think my last line ,the save path ,is not the right formulation...

Unfortunately,i try many things but i cant find the solution . If you can help me,i thank you so much..

TOM


//This is my code :

 

 

 

//import from folder

 

var targetFolder = Folder.selectDialog("Import Files From Folder");

              

                if (targetFolder) {

                                        var files = targetFolder.getFiles();

                                                          

                                            for (var i = 0; i < files.length; i++)

                                            {

                                                try {

                                                var importOptions = new ImportOptions (files[i]);                                                               

                                                app.project.importFile (importOptions);

                                                } catch (error) { /*alert(error.toString());*/}

                   }

               }

   

//find my sources Path

var PAthProject=targetFolder.parent;

 

//find myparent sources PAth

var PAthProject=targetFolder.parent;

 

//SAve in parent folder

var myNewFile = new File(PAthProject+ "/" + "myNewFile.aep");

app.project.save(myNewFile);


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>