Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Asistente de acciones

Community Beginner ,
Sep 15, 2025 Sep 15, 2025

Hola,

Agradecería si alguien me pudiese ayudar: necesito combinar más de 3000 pdf con su correspondiente portada.

La nomenclatura de los ficheros a combinar es:

nombredocumento.pdf

nombredocumentoPortada.pdf

Espero respuesta.

Muchas gracias

TOPICS
Create PDFs , Edit and convert PDFs , PDF
243
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Sep 15, 2025 Sep 15, 2025

Assuming all the files are located in the same folder, create an Action via Tools - Action Wizard and add to it a command to run a JavaScript with the following code:

 

if (/portada/i.test(this.documentFileName)==false) {
	this.insertPages(-1, this.path.replace(".pdf", "Portada.pdf"));
	this.saveAs(this.path);
}

 

Now run it on your folder, and you're done.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

Sorry, silly mistake on my part... Use this:

var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "AV/");
this.saveAs(newFilePath + newFileName);

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 15, 2025 Sep 15, 2025

Hi there 

 

Hope you are doing well and thanks for reaching out. We are sorry for the trouble you are experiencing. 

 

Would you mind sharing more details about the issue you are experiencing, what happens when you try to combine the PDFs Do you get any error message? If yes, please share the screenshot of the same for more clarity. 

 

To know more about how to combine the PDFs and user guided actions please check the help pages listed below:

https://adobe.ly/3K4iRtt 

https://adobe.ly/4nwwjEW 

 

Let us know if you experience any trouble and need more help.

 

~Amal

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2025 Sep 15, 2025

Assuming all the files are located in the same folder, create an Action via Tools - Action Wizard and add to it a command to run a JavaScript with the following code:

 

if (/portada/i.test(this.documentFileName)==false) {
	this.insertPages(-1, this.path.replace(".pdf", "Portada.pdf"));
	this.saveAs(this.path);
}

 

Now run it on your folder, and you're done.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 15, 2025 Sep 15, 2025

Muchísimas gracias try67, funcionó perfectamente.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 15, 2025 Sep 15, 2025

Ahora, ya por completar el automatismo sería posible que me guardase los ficheros resultantes en una carpeta nueva y añadiendo al nombre, por ejemplo _AV.

Espero respuestas, pero si no es posible con esto ya avanzaría en el trabajo.

Muchas gracias

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

Unfortunately, it's not possible to create a new folder using a script. It can only save files to folders that already exist.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 16, 2025 Sep 16, 2025

Muchas gracias

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

It is possible to save it under a different name (in the same folder, or another one), though.

Let me know and I'll adjust the code accordingly, if you wish.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 16, 2025 Sep 16, 2025

Perfecto, entonces me gustaría que el documento resultante lo guardase con el mismo nombre pero añadiendo _AV al final ([nombre del archivo]_AV.pdf) y en una carpeta que crearé dentro de la carpeta donde se procesan y se llamará AV.

Gracias por las molestias

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

OK, then replace this line in the code above:

this.saveAs(this.path);

 

With this:

var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "/AV/");
this.saveAs(this, newFilePath + newFileName);

 

Edited: Fixed a small mistake in the code

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 16, 2025 Sep 16, 2025

Gracias try67, pero no funciona, me pregunta uno por uno de los archivos si deseo guardarlo si le digo que no, no hace nada y si le digo que hace lo mismo que hacía antes dejarlo en la misma carpeta y sin sufijo.

No te preocupes que tal y como estaba al princio me puedo apañar, de verdad muchas gracias

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

Are you sure the path is correct, and that the folder exists?

To prevent it from asking you to save the file, add this to the end of the code:

this.dirty = false;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025

Sorry, silly mistake on my part... Use this:

var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "AV/");
this.saveAs(newFilePath + newFileName);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 16, 2025 Sep 16, 2025

Ahora funciona perfectamente, un millóoooooooon de gracias, si todos fuesen la mitad de buena gente que tú, el mundo sería un lugar maravilloso. 

Un saludo,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2025 Sep 16, 2025
LATEST

De nada! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines