Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
how to use multiple command in for loop

My Current Code is:

    function OnClick(data){
    var files = data.func.sourcetab.selected_files;
    var cmd = data.func.command; cmd.ClearFiles();
    var re = new RegExp("(.*) - ([0-9]*) - (.*)(\.mp3|\.flac)");


    for(var i=0;i<files.count;i++){
    //  DOpus.Output("File: [" + files(i).name+"]");
        var matches = String(files(i).name).match(re);
    //  if (!matches){ DOpus.Output("    skipped"); continue; }
        var artist = matches[1];
        var track = matches[2];
        var title = matches[3];
        var cmdli = 'SetAttr META="artist:'+artist+'" "track:'+track+'" "title:'+title+'" FILE="'+files(i).realpath+'"';
        //DOpus.Output("    cmd: " + cmdli);
        cmd.RunCommand(cmdli);
    //  cmd.RunCommand('Rename FROM="'+ files(i) +'" TO="' + title + '" IGNOREEXT');
    }

    for(var i=0;i<files.count;i++){
        var matches = String(files(i).name).match(re);
        var title   = matches[3];
cmd.RunCommand('Rename FROM="'+ files(i) +'" TO="' + title + '" IGNOREEXT');
    }
    }

Here I have used 2 for loop, the 2nd for loop used for run this command cmd.RunCommand('Rename FROM="'+ files(i) +'" TO="' + title + '" IGNOREEXT'); Is there any way to run this command in my 1st for loop? If I can run this command in 1st for Loop then I don't need to write the 2nd for loop command.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda