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

Bookmark JS Causes errors

Terrill
Registered: May 4 2007
Posts: 14

I have created bookmarks which send the user to various fields in my Acrobat 8 form. The bookmarks work correctly, doing exactly that which is intended. However, when I open the JS Console, I get a slew of "SyntaxError: unterminated string literal
1:debugexec" errors. If I delete all of the bookmarks, no more errors. The scripts are all very simple. I've tried two formats:
 
var f = this.getField("txtName");
f.setFocus();
 
and:
 
this.getField("txtName").setFocus();
 
Both yield the same errors.
 
What gives?

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're problem is somewhere else. The code above has nothing to do with it. In fact, the problem may not be in the form at all. There's nothing in the error message that indicates the error in from the bookmark script, or even from the document. Can you post the form somewhere we can download it and take a closer look?

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

Terrill
Registered: May 4 2007
Posts: 14
Thom,

Thanks for the QUICK reply!

I've uploaded the offending file to one of my web sites. Download it [url=http://www.dont-know-my.name/tomPDF/E-AppTest.pdf]Here[/url]. Remember, it's a work in progress, eh?-)

It's curious: I have:

1. Deleted all the bookmarks, and the errors go away. Don't save, re-open, and...

2. Menus: "Advanced » Document Processing » Edit All JavaScripts" and copied the code to Vim. Searched for open parentheses, made sure all opens have closed (I love manual labor, don't you?). Searched for double-quote, and matched em all.

3. Pulled my hair out.

All to no avail.

I've tried setting the debugger to break on errors, but it doesn't. At least, not on the error I've reported. It just keeps truckin' like there's no tomorrow.

I appreciate your help!

-- Terrill --