Hi
I want to make a palette with several buttons, which can let me open definied projects, and other useful scripts.
How to import a specific comp (ie : an exisiting myComp.aep) with script?
thks
import comp
Moderator: Paul Tuersley
Hi Zantek,
you can't import a comp, a composition is not a file.
To import a single file (without safe options), put something like this in your click event function (see the smartImport.jsx demo script for more details)
To execute a script from the palette, look at the DemoPalette script that comes with AE.
you can't import a comp, a composition is not a file.
To import a single file (without safe options), put something like this in your click event function (see the smartImport.jsx demo script for more details)
Code: Select all
function OnImportBtnClicked()
{
app.project.importFile(new ImportOptions(theFile));
}
thanks.
After few searches i found this:
so it loads my new project.
I'd like to add a "if" in case of MyCompo.aep is still opened, so it asks the user to save (under a new name for example or something else) before open MyComp.aep .
After few searches i found this:
Code: Select all
function openComp()
{
var my_file = new File(".../thePathTo/MyComp.aep");
if (my_file.exists){
new_project = app.open(my_file);
if (new_project){
alert(new_project.file.name);
}
}}
I'd like to add a "if" in case of MyCompo.aep is still opened, so it asks the user to save (under a new name for example or something else) before open MyComp.aep .