These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Automating a series of Batch Sequences

saj
Registered: Oct 15 2008
Posts: 52

I have series of batch sequences (20) that need to be done in a specific order and currently are done by clicking on each one after the last one is completed. Is there a way to automate all the batch sequences to run one after another? Or does anyone know a plug in that does this on the Mac side?
 
Any insight would be greatly appreciated.
sj

My Product Information:
Acrobat Pro 10.0.2, Macintosh
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
IMHO, cannot combine Actions is the main lack of the Actions wizard…

So, AppleScript and Automator are made for you : http://macscripter.net/index.php

;-)
try67
Expert
Registered: Oct 30 2008
Posts: 2401
Are you sure that it's not possible to combine some of the actions into a single one? You know, you can add multiple commands to a single action.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
Unfortunately no. Basically, the series of steps are making layers, turning off all the layers, flattening, then exporting the background as a jpeg and then opening the layers file with just the text and importing the jpg back in with the text and flattening it again. In order to do this it requires the "saving" of the file..and opening based on the file name. It would be nice if there was some plug-in that could stack the scripts you want to happen and they automatically run. I have tried automator..but, it errors out easily...and I don't know applescript enough to do this.
thanks,
sj
try67
Expert
Registered: Oct 30 2008
Posts: 2401
Why not add a command to save the file between each step?
Edit: You can try something like: this.saveAs(this.path);

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
I tried that once, but I'll try it again. I think I gave up because of my frustration with my "lack-of-knowledge." Let me try again.
Your help is appreciated.
-sj
saj
Registered: Oct 15 2008
Posts: 52
Okay, I'm hung up. I got the saveAs part with the path correctly done. But, how do it get it to save everything in that folder.
currently it says: this.saveAs("/Computer/user/admin/Desktop/book/test/1.pdf");
But, I could have 52 files named 1.pdf, 2.pdf...etc. or there could be less. I want everything in the folder saved with the same name.
help?
try67
Expert
Registered: Oct 30 2008
Posts: 2401
Why are you hard-coding the file name in the script?
Use the code I've provided earlier. It will save each file under it's original name:
this.saveAs(this.path);

If you want to save the files using the same name but in a different folder, you can do something like this:
this.saveAs("/Computer/user/admin/Desktop/book/test/"+this.documentFileName);

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
Got it!!!! :)
One more question...and I'll stop bugging you. What about opening a file? There are two types I need-- one that is for a specific pdf and one that is for everything in the folder....

I'm so excited...for what you are teaching me! :)
try67
Expert
Registered: Oct 30 2008
Posts: 2401
Sorry, but you can't open a PDF in the middle of a batch process. Here's what the reference of openDoc says about it:
Quote:
When a batch sequence is running, a modal dialog box is open, which prevents user interference
while processing. Consequently, this method cannot be executed through a batch sequence.
But may I ask what's the purpose of opening this file? What do you need to do with it, exactly?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
It is my understanding when you take a file into layers. you need to close it and open it again in order to work with the layers.

Here is how I am currently doing it.
1. Making Layers (preflight) (all items are folder to folder)
2. Then I'm opening each file up and turning off the text layer and exporting as a jpeg. (folder to folder)
3. Reopening the layers file and turning off everything except for the text. Flattening. (folder to folder)
4. Opening the "text" layered file and merging with the appropriate jpeg. So, it opens 5.pdf and 5.jpg will be placed as a layer and flattens it. (file to file / folder to folder)
5. Combines the individual pages into a single pdf
6. Crops, Reduces size.

So, if I can't open a file...i'm not sure how I'd get number 4 to work.

do you have any thoughts?

try67
Expert
Registered: Oct 30 2008
Posts: 2401
How are you adding this new layer now? Are you using addWatermarkFromFile()?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
no I'm adding it through the import layer. Should I be importing it as a watermark instead?
You got me thinking...is there a possible script that would would add a different watermark to each page, if I would merge the file together earlier in the process?
try67
Expert
Registered: Oct 30 2008
Posts: 2401
Yes, it's possible. Read up on addWatermarkFromFile (and possibly addWatermarkFromText). You can use them to add a watermark to one or more pages as an OCG (Optional Content Group).

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

saj
Registered: Oct 15 2008
Posts: 52
sounds good....I'll see what I can do.
thanks!