简体   繁体   English

在 Adob​​e Acrobat Pro DC 中创建自定义击键脚本时,初始化变量“AF”会删除整个脚本

[英]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"]; var test = ["AF"];

I have tried the initialization in the Debugger and it works fine but it won't work in the PDF.我已经在调试器中尝试了初始化,它工作正常,但它在 PDF 中不起作用。

I also tested我也测试过

var test = "AF"; 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?为什么我不能在 Adob​​e Acrobat Pro DC 中使用自定义击键脚本初始化字符串“AF”?

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.在测试时,我使用了字符串“Af”、“BF”、“ALFALFA”、“AFTER”、“AFRICAN”和“NAFTA”,前 3 个工作但只要有大写的“A”和大写的“F” " 以该顺序在字符串中使整个脚本消失。

I go into edit Custom Keystroke Script:我进入编辑自定义按键脚本:

第1步

I then type the offending var test = ["AF"];然后我输入有问题的 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" "南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. Acrobat 使用预装函数将用户界面映射到 JavaScript。 They all start with AF.它们都以 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. ... 因为自定义击键脚本将导致 Acrobat 将属性对话框切换到下图。

在此处输入图片说明

The code is actually still in the field dictionary but Acrobat is programmed to display this dialog when it sees that script.该代码实际上仍在字段字典中,但 Acrobat 被编程为在看到该脚本时显示此对话框。 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. Acrobat 中用于检测这些脚本的代码似乎过于激进,并试图将任何带有 AF 的代码字符串转换为对话替代品之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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