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

javascript to run batch seqeunce suppress warnings and errors

binuraj
Registered: Mar 27 2008
Posts: 6
Answered

Through Acrobat 5.0 I can run a custom batch sequence through execMenuItem command in javascript. But in Acrobat 7.0 Professional is this facility not available? Also in Acrobat 5.0, how I can suppress the "Errors and Warnings" window coming when the execMenuItem command is executed, which waits for the interaction for clicking the "Ok" Button. Otherwise, it can be run without any interaction. I run from an applescript in the following way:

do script "app.execMenuItem(\"AVSequenceMenuItemAtom-10\");"

Many thanks in advance, for the kind help.

--
Binu Raj

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In Acrobat 5, the batch sequences were added as menu items for quick access. This is a great idea except for two things. Lots of batch processes are problematic, and, the biggest problem, it allows batch processing to be used in external automation. Kind of a double automation which is a no-no for Acrobat. That's why is was immedaitley removed in the next version.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

binuraj
Registered: Mar 27 2008
Posts: 6
Thank you for the reply. Still I have one query pending: how I can suppress the "Errors and Warnings" window coming after a batch sequence, which waits for the interaction for clicking the "Ok" Button. Thanks a lot, again.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are some exceptions, but generally you cannot suppress the display of error or warning popup boxes. What error or warning is being displayed?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

binuraj
Registered: Mar 27 2008
Posts: 6
I use a third party plugin called "Quite a Box of Tricks" to convert colors of all pages to CMYK or some times to Grayscale. And it is used to thicken lines in the artwork whose thickness is below a particular standard.

The messages will be like "3 pages modified out of 5 pages checked" or "Nothing to convert" etc.

Now I am forced to use automator softwares to simulate mouse movements and clicking on these items to run automatically without manual intervention, which sometimes get stuck when the automator fails. Should I go back to Acrobat 5 for automating batch sequences using javascript? It is necessary to run it without intervention as far as our work is concerned.

Thanking you for the kind support. Expecting your valuable suggestions in this regard.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So this popup message is from a 3rd party tool? not Acrobat! If this is the case then you'll have to talk to Quite about it. In fact, Andy answers questions on the Adobe User to User Forums. You might try posting there.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

binuraj
Registered: Mar 27 2008
Posts: 6
Yes, that must be true. It was an eye opener. Thank you for that. What we need is that colours in each object (text, line art, images) to be converted into gray or sometimes cmyk. I recently got an info that Acrobat 8 has the javascript support for colour conversion of objects with the function colorConvertPage().

1. Is that function able to accomplish our need?

2. Is there any option to thicken the lines in artwork whose stroke weight is below a specified point in Acrobat?

If both works then the automation can be done without manual intervention through javascript, which is the most efficient and reliable way rather than using the third party plugin or simulating mouse movements.

Thank you for all the kind help and suggestions extended.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The color convert function in Acrobat JavaScript will convert images, lines, etc. to any color profile listed in "app.app.printColorProfiles". These are the color profiles available on your system. Unfortunately Acrobat doesn't seem to respond to just setting the conversion to "Default Gray" or "DeviceGray", it crashed when I tried to do this. It seems you need the actual color profile, even for defaults:(

It will not thicken lines.

I wouldn't dismiss 3rd party tools. While Pitstop isn't an automation tool, it'll do everything you want in a single action and it works with "Switch" from Gradual, which is an automation tool. Switch can also run Acrobat JavaScript Actions, so you can combine both Pitstop and JavaScript into a single workflow. "www.apago.com" also has some automation tools that might help out in this area.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

binuraj
Registered: Mar 27 2008
Posts: 6
Thanks a lot for the valuable suggestions. It was of a great help. I will look into the third party tools.