Disappearing script
Copy link to clipboard
Copied
After entering a Custom Keystroke Script in the edit box, the script works but it disappears from the edit box when revisiting the format properties.
It is also not shown in the "Edit All Scripts" lists of scripts.
Even after saving the file and opening it again, the script is gone but still works.
Using Acrobat Pro DC 2019.012.20035
Note: There is no Custom Format Script; only a Custom Keystroke Script.
How can I view the Custom Keystroke Script again and update it?
Thanks
Copy link to clipboard
Copied
This happens when you include specific strings that the application thinks are a part of an internal code that is used for the built-in Keystroke commands. It then attempts to display the matching option in the GUI and hides the code. I think it should still be available via Edit All JavaScripts, though...
If you didn't use an undocumented JS method then you can overcome this issue by making sure your code doesn't contain the string "AF".
Copy link to clipboard
Copied
Thank you try67.
Here is the sccript.
if(!event.willCommit){
num=AFMergeChange(event);
num=NumToWordsInt(num);
this.getField("Output").value=num;
}
It updates the output box with converted number.
Copy link to clipboard
Copied
The use of the AFMergeChange function is what's causing it to happen.
Copy link to clipboard
Copied
Thank you. Is there a way to avoid using a function call within the Keystroke script and obtain the same result.
I want to call the NumToWorsInt() function on a keypress to dynamically convert the number in another box.
Thanks again.
Copy link to clipboard
Copied
Put all of that code in a function under a doc-level script and then just place a call that function from the event itself. I believe that should solve it.

