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

195
Views
La línea con "reemplazar" no funciona si la escribo para que funcione

por favor ayúdenme, whi replace no funciona. Gracias. Si escribo una línea con reemplazar fuera de la función, funciona, pero la función interna no funciona... no sé por qué, porque las alertas funcionan bien... Es un script para reemplazar el metraje que elijamos del menú desplegable.

 //show window var mainWindow = new Window("palette", "", undefined); mainWindow.orientation = "column"; var iconName = ["Bourky_s_destem.mov", "Bourky.mov", "Dest_se_snehem.mov", "Jasno.mov", "Mlhy.mov", "Mrholeni.mov", "Mrznouci_dest.mov", "Oblacno.mov", "Prehanky_dest_se_snehem.mov", "Prehanky.mov", "Skorojasno.mov", "Snehove_prehanky.mov", "Snezeni.mov", "Trvali_dest.mov", "Zatazeno.mov"]; var groupOne = mainWindow.add("group", undefined, "groupOne"); //show dropdown menu var PH_lisabon = groupOne.add("dropdownlist", undefined, iconName); PH_lisabon.size = [200, 25]; PH_lisabon.selection = 0; var PH_berlin = groupOne.add("dropdownlist", undefined, iconName); PH_berlin.size = [200, 25]; PH_berlin.selection = 0; var PH_nice = groupOne.add("dropdownlist", undefined, iconName); PH_nice.size = [200, 25]; PH_nice.selection = 0; var groupTwo = mainWindow.add("group", undefined, "groupOne"); var applyButton = groupTwo.add("button", undefined, "Apply"); mainWindow.center(); mainWindow.show(); // this is work - app.project.item(1).replace(new File(['./ikony/' + PH_berlin.selection.text])); //click on apply button applyButton.onClick = function() { findAndReplaceIcons(PH_berlin.selection.text, "PH_berlin.mov"); } // replace footage function findAndReplaceIcons(iconOnLocation, placeHolderName) { for (var i = 1; i <= app.project.numItems; i ++) { if ((app.project.item(i) instanceof FootageItem) && (app.project.item(i).name === placeHolderName)) { alert(iconOnLocation); alert(placeHolderName); alert(app.project.item(i).name); app.project.item(i).replace(new File(['./ikony/' + iconOnLocation])); break; } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que solo se trata de eliminar los corchetes de la ruta del archivo.

 app.project.item(i).replace(new File(['./ikony/' + iconOnLocation]));

Debiera ser:

 app.project.item(i).replace(new File('./ikony/' + iconOnLocation));

Aunque también creo que es poco probable que su intento de usar ./ para una referencia relativa le dé lo que quiere. Es posible que necesite usar algo como:

 var path = app.project.file.path + '/ikony/' + iconOnLocation; app.project.item(i).replace(new File(path));
about 4 years ago · Juan Pablo Isaza Report
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!