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

335
Vistas
Partial match file to string - String and CSV file both contain timestamp in the name, seconds of the difference between the two timestamps/names

I'm a complete JavaScript rookie...actually complete rookie with programming in general, so please bare with me.

Basically I have a Premiere Pro script that takes a CSV file and converts its data into clip markers, and that part works fine and everything.

The issue I'm currently dealing with:

Instead of just having to manually select a CSV file using File.openDialog() every time I want to generate markers, I thought I'd just hardcode the file path(always the same path so it made sense) + grab the clip name (both the CSV files and clips have a date timestamp as their names) and just grab the CSV from the path with the matching clip name.

var clip = // "insert clip name here.mp4", example: 2021-09-21 00-50-27.mp4       

var clipname = clip.name.replace(".mp4", '.csv'); //my janky way of dealing with the extensions lol
    
var userCsv = File (('/d/TIMESTAMPS/CSV/') + escape(clipname));

//userCSV example: "[File] /d/TIMESTAMPS/CSV/2021-09-21%2000-50-27.csv"

parseCsvData(userCsv);

Now, this works fine, except when the CSV's name timestamp is a few seconds behind, so the CSV file can no longer be matched to the clip name.

Example:

clip name: 2021-09-21 00-50-27.mp4

CSV name: 2021-09-21 00-50-29.csv¨

So now I'm trying to figure out a way to match the CSV to the clip even if the seconds in the timestamp/name are off, let's say give it a range of 10 seconds of difference and still be able to get a match.

Now I'm thinking of 2 possible ways to deal with this.

  1. Do the math and find the seconds of difference between the two
  2. Just match the two strings with minute accuracy and discard the seconds...and also hope that the timestamp doesn't hit 59 seconds and then get a difference in minutes between the two...I'd probably use File.openDialog() as a fallback in that case I guess.

I'm using Adobe ExtendScript Toolkit if that matters in any way.

Any idea on how to solve this? Thank you!

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