Acrobat script // Need help

Post Reply
bens
Advanced member
Posts: 253
Joined: Thu Mar 03, 2011 10:13 am

Re: Acrobat script // Need help

Post by bens »

Some details depend on how you are trying to use this script. I will assume it's used in one of the properties of the Acrobat element in a Switch flow.

First, get rid of the "<script type="text/javascript">" and "<script>" tags. Those are html tags, but Switch and Acrobat use JavaScript directly - no html.

As you noted, "this" is incorrect. You want it to be the document, provided by Switch. Replace every instance of "this." with "$doc."

The script will show an alert window if something goes wrong. In an automated environment this is usually not what you want, since the application will block until the user clicks the alert. Instead, you want to signal the error back to Switch. Change "app.alert(e);" to "$error = e.description"

More information can be found in the Switch help under "JavaScript for applications".
bens
Advanced member
Posts: 253
Joined: Thu Mar 03, 2011 10:13 am

Re: Acrobat script // Need help

Post by bens »

Unfortunately you cannot test Adobe scripts in SwitchScripter. You'll have to create a simple flow in Switch and test it there.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Acrobat script // Need help

Post by gabrielp »

All Systems Integration provided us a script to do exactly this. We had to break apart the PDF, dupe the pages, then merge the PDF back together. If that sounds like it would work for you, maybe just send them an email asking for it?
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
User avatar
andrea mahoney
Newbie
Posts: 19
Joined: Tue Jan 25, 2011 8:53 pm

Re: Acrobat script // Need help

Post by andrea mahoney »

Hi,
Your script should be installed in the Command Section of the Acrobat Configurator, not the Save Section. Use the save section to save the pdf and close Acrobat.
Post Reply