Sorry for the spanish translation:
This works well, I’m not using the folder part right now because I prefer to import the files one by one, but thanks anyway. I share my final script if useful to someone.
var myfile = app.project.importFileWithDialog();
var myText = app.project.items.addComp( "text", 1080, 1920, myfile[0].pixelAspect,myfile[0].duration,myfile[0].frameRate);
for (var i = 0; i < myfile.length; i++){
var myComp = app.project.items.addComp( myfile[i].name, myfile[i].width, myfile[i].height, myfile[i].pixelAspect,myfile[i].duration,myfile[i].frameRate);
var nameComp = myfile[i].name
var newObj = myComp.layers.add(myfile[i]);
var format;
//COMP LANDSCAPE
format = nameComp.indexOf("landscape");
if (format != -1) {
var addText = myComp.layers.add(myText);//adds myfile to mycomp
myComp.layer("text").rotation.setValueAtTime(0,-90);
myComp.layer("text").position.setValue([1180,540]);
}
var myRender = app.project.renderQueue.items.add(myComp);
}