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

Keystroke code not "sticking" in Acrobat 9 and 7

maxwyss
Registered: Jul 25 2006
Posts: 256
Answered

I just encountered a very weird effect in both Acrobat 9 and Acrobat 7.

In both cases, I created a blank page using the newDoc() command. Then I placed a text field on it. After setting the appearance, I tried to add a Custom Format, Keystroke script. The JavaScript editor opened, the script got entered.

So far so fine, but after confirming OK, the field properties dialog got back to "no format script", and the entry got lost.

Has anyone out there encountered such an effect before?

BTW, this happens under MacOSX 10.4.11...

Restarting Acrobat did not fix the issue. I have, however, not yet restarted the computer.

Thanks in Advance for any insight.

Max.

My Product Information:
Acrobat Pro 9.0, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
What was the script? I've had that happen when I've used some of the built-in routines, and avoided it by placing the code in document-level functions and calling the functions in the field events.

George
maxwyss
Registered: Jul 25 2006
Posts: 256
Hmmm...

I am actually using a built-in routine...

Actually, I was able to make it stick in Acrobat 5 (yes, the best Acrobat ever... still).

The code now looks like this:

if (event.willCommit == true) {
event.value = util.printf("%,2.2f", AFMakeNumber(event.value.toString())) ;
}

Although it does not work in all cases; When reloading a string formatted like that, it returns NaN, which is correct.

But this is not the concern... The concern is that the code does not stick, and that there is no error message whatever.

Hmmm...

I think you are definitely right with this assumption.

I did a little experiment:

Entering a simple comment, such as

// do nothing

did stick. But as soon as I added the code above, it lost its mind.

I guess we have another annoying bug ....

Thanks for the hint.

Max.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Max,

I have a similar problem with version 8 pro when using an external editor for the first script being entered into a PDF. I use Acrobat's editor for the first field and can then switch back to the external editor. I also have problems with the built in calculation options. I suspect this might have to do with the operating system level JavaScirpt engine.

George Kaiser

maxwyss
Registered: Jul 25 2006
Posts: 256
Thanks gkaiseril,

It seems to not be an editor issue, as I get the same effect in Acrobat 7 using an external editor (TextWrangler), and in Acrobat 9, using the internal one.

... and it is the first field in the form, I agree... in fact, it is the only field in the form.

Max.