Re: Acrobat script // Need help
Posted: Fri Mar 27, 2015 9:41 am
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".
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".