Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

var test = "AF"; makes Custom Keystroke Script vanish

New Here ,
Feb 27, 2019 Feb 27, 2019

I have been trying to make an array using a Custom Keystroke Script for a form field and after much troubleshooting discovered that for whatever reason trying to put the string "AF" into a var makes the entire script vanish when I click the OK button.

Using the following causes script to vanish.

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. BOLD cause issue.

I go into edit Custom Keystroke Script:

Step 1

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

script

Then it drops me back out to this.

After I click OK

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

What it should do

TOPICS
Create PDFs
950
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2019 Feb 27, 2019

I think I know why this is happening, yes.

Acrobat has a set of built-in, hidden, functions that start with AF that are used for various things like the Format and Keystroke events. For example, the built-in function that is used when you select the Date option under Format is called AFDate_KeystrokeEx. If you enter code that uses this function name the code disappears from view, even though it's still accepted.

My guess is that there's some kind of built-in mechanism in the application that looks at the code and if it contains the string "AF" then it treats it as if it's using one of those built-in functions and tries to display those settings in the UI. If it can't do that it shows as if nothing was entered. Not great software design, really...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 27, 2019 Feb 27, 2019
LATEST

Not sure if this is actually the reason, but if it is you are right, NOT great software design.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2019 Feb 27, 2019

You can use "A" + "F"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 27, 2019 Feb 27, 2019

Thank you, this is a functional workaround. Just super annoying it is necessary.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines