Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!