Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda