简体   繁体   中英

While Creating a Custom Keystroke Script in Adobe Acrobat Pro DC initializing variable "AF" deletes whole script

When I attempt to create the following Array

var test = ["AF"];

I have tried the initialization in the Debugger and it works fine but it won't work in the PDF.

I also tested

var test = "AF";

that also doesn't work. Why can I not initialize the String "AF" using a Custom Keystroke Script in Adobe Acrobat Pro DC?

While testing I used the strings "Af", "BF", "ALFALFA", "AFTER", "AFRICAN" and "NAFTA", the first 3 work but as long as there is a capital "A" and a capital "F" in the string in that order it makes the entire script vanish.

I go into edit Custom Keystroke Script:

第1步

I then type the offending var test = ["AF"]; and click OK.

脚本

Then it drops me back out to this.

我点击确定后

When I go back in and try a different string it does this.

它应该做什么

"SOUTH A\\FRICAN RAND" "A\\F"

Using an escape character fixes the problem.

That's a bug. Acrobat uses pre-canned functions to map the user interface into JavaScripts. They all start with AF. For example, setting ...

AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)

... as the custom keystroke script will cause Acrobat to switch the properties dialog to the image below.

在此处输入图片说明

The code is actually still in the field dictionary but Acrobat is programmed to display this dialog when it sees that script. It seems that the code in Acrobat to detect these scripts is overly aggressive and is trying to convert any code string with AF in it into one of the dialog substitutes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM