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

194
Vistas
Running a script on all .ai files in a directory

I'm a graphic designer and a beginner at coding. So please dumb down for me :)

I have a script that I run through Illustrator. It embeds an image and removes a clipping mask on the file. I need this script to run on multiple .ai files in a folder.

The thing is, I cannot create a batch action (in Illustrator) to run the script. Our IT guy doesn't want to add the script to our Illustrator settings on multiple accounts. Is there a way to add code to my script to do this?

I need it to open all the files, run the script and save. The files can be left open on Illustrator, no need to close.

What code do I need to add to my script?

I am on a Mac not PC.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It can be done this way:

function my_script() {

    // copy a full text of your script here

    // or include the jsx file this way:
    # include '~/Desktop/script/my_script.jsx'

}

function main() {

    var folder = Folder.selectDialog('Please, select the folder');
    if (!(folder instanceof Folder)) return;

    var files = folder.getFiles('*.ai');
    if (files.length == 0) {
        alert('Folder doesn\'t content AI files');
        return;
    }

    var i = files.length;
    while (i--) {
        var doc = app.open(files[i]);
        my_script();             // <------- here your script is running
        doc.save();
        doc.close();
    }

    alert(files.length + ' files were processed');
}

main();
about 4 years ago · Juan Pablo Isaza Denunciar
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