Copy link to clipboard
Copied
I have a trusted script (_myTrustedScript) that uppercases the first letter of each word in a text field. Sometimes it appears in the 'Calculate' tab of a text field. Other times it appears within a javascript in the 'Actions' tab of a text field (because those fields also have other actions going on as well as the capitalization). The form itself has about 150 fields, perhaps a third of which are text fields that may or may not reference this script.
I've now decided to rename this trusted script to have a more appropriate title (_myTrustedScript becomes _myCapitalization). Now I have to find and update all of the text fields that reference the old script name.
Can Adobe help me find out which fields I need to update? I know that I could run the form and check the console for errors, but not knowing how to read those errors very well makes it difficult for me to identify the fields in question. As an analogy of what I'm after: if I were doing this in a text file, I would <ctrl><f> to find a pattern and then hit NEXT to access the subsequent occurrences. I don't mind replacing all of the references manually, I am just looking for an easy way to find them all. I've already done them tonight on my form... it took me about 45 minutes because the console kept giving me errors but I didn't know how to use that information to find the affected fields. I had to look through them all, one at a time, on both the 'Calculation' and 'Action' tabs, until the errors stopped appearing. I expect I could have accomplished this in less than 10 minutes if I had some way of generating a list of affected fields, or of jumping from one affected field directly to the next.
Ultimately, if I'm going to continue using Adobe for projects, I must learn to use better script titles right off the bat, but I expect that even if I do so, I will eventually have a similar need in the future. So any tips would be appreciated.
Thanks in advance...
Copy link to clipboard
Copied
You can look at Tools > JavaScript > All JavaScripts
Copy link to clipboard
Copied
You can look at Tools > JavaScript > All JavaScripts
Copy link to clipboard
Copied
But do NOT make any changes there. Doing so can seriously damage your file. Use that command to locate where the function is referenced and then go to those fields and edit it there directly.
Copy link to clipboard
Copied
Thank you. I just took a look at that tool and it seems to be just what I was asking for. A quick copy/paste into a text file and I can use 'vi' to quickly narrow down the target of interest. And I understand that I should not make changes here, but instead should use this to locate the places where I can go and make the changes. Thank you both!
Copy link to clipboard
Copied
You should decide to rename this script when starting a new form.
It would be a more logical and simpler choice.
Copy link to clipboard
Copied
PS. Why a trusted script? This action doesn't require a trusted context...
Copy link to clipboard
Copied
So far I have written 8 scripts, some of which need to be run in a trusted environment. As I was writing them, I was inconsistent and not very descriptive when originally naming them. I had already renamed two trusted scripts, one that extracts pages from one file to create another, and one that saves a newly created file to a specified folder. So I had already gone through my PDF looking for all references and updating them as to the new filename. I wrote my question just after finishing similar changes to the script that upper cases the first letter of each word. You're completely right, the function I described does not require a trusted script... I probably should not have used the word 'trusted' when I described the example. Sorry for the confusion...
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more