What's new

Batch Automation Automation to insert 100 pages in a mockup


luizdsilveira

New Member
Messages
4
Likes
0
Hi.

I work in a Magazine and regularly I need to make a mockup with a double page to show to some costumers. I already have a mockup of the magazine with 3 linked PDFs: cover, left and right pages. So I just need to change those 3 PDFs for the new cover and the 2 pages, open Photoshop and update the links inside smart objects. It's easy and quite fast.

BUT yesterday I needed to do it with 52 double pages, and took me some time. I did the processes above and every time saved the PSD as JPG with a new name. No big deal.

What I was thinking is if is possible to make it all automatic. :) Sometimes I work with layercomps inside SmartObjects, but I need to change them manually and export one by one. Maybe is there a way to:

1. Import all Left and Right pages inside the SmartObjects.
2. Make a layercomp with each of them.
3. Make PS change the layercomp pair at the same time, exporting each pair with a new name.

:) Okay, I know it's asking too much, but maybe there is some solution I'm not seeing.

Thanks,
Luiz
 

thebestcpu

Guru
Messages
2,025
Likes
1,864
Hi Luiz

To be honest, what you are describing may be crystal clear to you (you are very close to your work) yet what you are trying to do is not very clear to me. A lot of details left out to give good recommendations. Are just the templates in PDF format and then you are inserting images? Are you saving back out as PDF or individual pages etc.

Without a detailed understanding of your specifications or workflow, here are some thoughts.

This could be done by a Photoshop Script

It likely could be done by scripting outside of Photoshop and just changing the content of the linked files externally (they update in PS automatically then)

Or, you could switch to a raster based approach vs Smart Object approach and use Photoshop variables substituting in raster images as needed.

Hope the above gives you some ideas to pursue.

John Wheeler
 

luizdsilveira

New Member
Messages
4
Likes
0
Dear John,

Sorry I was not clear. Let me explain better:

1. I have a mockup with 3 smart objects. One for the cover and one for each page in a open magazine.
2. I have a PDF with all magazine pages.
3. What I need is to insert some pages in this mockup, changing inside the smart object.
4. Today I do it manually: I open a smart object, drag and drop the PDF, select the desired page, insert and save.

My question is about a way to make PS open a smart object, insert a page from the PDF, close the smart object and save the file as JPG. Then open again the smart object, put another page from the PDF, close, and save as JPG. "For i = 1 to all PDF pages". :)

But what you said about the script outside make a lot of sense! I can make it use all PDF pages (I can split each one in one file), insert in PS, update, save and repeat. I was trying to make it direct in PS, not thinking about automator and Apple Script.

Thanks a lot, will give it a try.
Luiz

Hi Luiz

To be honest, what you are describing may be crystal clear to you (you are very close to your work) yet what you are trying to do is not very clear to me. A lot of details left out to give good recommendations. Are just the templates in PDF format and then you are inserting images? Are you saving back out as PDF or individual pages etc.

Without a detailed understanding of your specifications or workflow, here are some thoughts.

This could be done by a Photoshop Script

It likely could be done by scripting outside of Photoshop and just changing the content of the linked files externally (they update in PS automatically then)

Or, you could switch to a raster based approach vs Smart Object approach and use Photoshop variables substituting in raster images as needed.

Hope the above gives you some ideas to pursue.

John Wheeler
 

luizdsilveira

New Member
Messages
4
Likes
0
Thanks, John. I've downloaded the free package for now, and I'm testing them. Was a great idea to use actions outside PS. It's less limited. I'm used to make scripts to Illustrator and Indesign, but never did nothing to PS. It's time to try. :)


Hi Luiz

Hope that works for you.

You might also want to consider a Photoshop addon to Automator. There is a free set of actions and also a more extensive version for about $20 from this web site. Might even give you more ideas for automation with PS: http://www.robotphotoshop.com/?page_id=8

John Wheeler
 

luizdsilveira

New Member
Messages
4
Likes
0
Hi. John.

I wrote a script and solved my problem. You can find it below. I've put some comments do make things easier. :)

Thanks a lot for your help. Now I can run this script and go grab a coffee while it work with my 100 files. :)
Luiz

-----



set sourceFolder to choose folder with prompt "Select Source Folder"




set destinationFolder to "A FOLDER WHERE I HAVE FILES LINKED IN MY MOCKUP" as alias
set finalArq to "A FOLDER MY PHOTOSHOP ACTION USE TO SAVE_4_WEB THE FINAL JPG FILE" as alias




tell application "Finder"


set theFiles to the files of sourceFolder

-- I have a folder with one PDF for each page. Script will rename file 1 to Left and file 2 to Right.


repeat with n from 1 to (count of theFiles) / 2 by 1
set theFiles to the files of sourceFolder
set the name of item 1 of theFiles to "Left.pdf"
set the name of item 2 of theFiles to "Right.pdf"
move file "Left.pdf" of sourceFolder to folder the destinationFolder with replacing
move file "Right.pdf" of sourceFolder to folder the destinationFolder with replacing

-- now that I have Left and Right files in the folder PS Action will search for it, it will run the action that update the links and Save For Web this updated mockup.


tell application "Adobe Photoshop CC 2015"
do action "NAME OF MY ACTION" from "FOLDER OF MY ACTION"
end tell

-- Below the script will rename the Save for Web file to a name + a number. Just to avoid PS to overwrite the files. I used the count of PDFs from original folder, updating the number when asking it to "recount" itens in the folder. Remember that in every loop it moves Left and Right files, so folder has always 2 files less than the last loop.


set contagem to (count of theFiles)
set the name of file "Materias_Colunistas copy.jpg" of finalArq to "Materias_Colunistas_" & contagem

end repeat
end tell
 

Top