I'm trying to get the name of a composition and change it to something else. I know that it is possible when I select the comp (active), but I would like to do it automatically.
Sample: In a project (name = eps111_sc222_v02.aep) I have a dozen comps, the one I would like to change is named "eps111_sc222_V01".
Now I would like to search for all comps in my project that include "_V". Basically like this:
// get new name from project, project name
var currentFile = app.project.file.name;
currentFile = curFile.substring(0,curFile.length-4);
for (var i = 1; i <= app.project.numItems; i++)
{
if((app.project.item(i)instanceof CompItem)
&& (app.project.item(i).name === "_V"))
{
app.project.item(i).name == currentFile;
}
}
So, the comp should get the name of the project. Is that possible?
I tries this also:
var string=app.project.item(i).name;
expr = "/_V/";
string.search(expr);
but I think my problem is: how do I get the values here...?